Home » Developer & Programmer » Forms » unable to delete master which has detail
unable to delete master which has detail [message #245789] Mon, 18 June 2007 15:53 Go to next message
vinodkumarn
Messages: 60
Registered: March 2005
Member
Hi all,

I have 3 blocks namely block1, block2, block3
block1 is the master of block2 and block2 is the master of block3

block1 = 1 record
block2 = 2 records
block3 = 2 records

relationship is cascading

i am trying to delete record in bock1 so that i also delete record in block2 and block3 automatically

i can delete record in block1 but cannot save

can anyone help me here

Vinod
Re: unable to delete master which has detail [message #245814 is a reply to message #245789] Mon, 18 June 2007 19:51 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Setting and Description in relationship Delete Record Property.

Non-Isolated The default setting. Prevents the deletion of a master record when associated detail records exist in the database.

Isolated Allows the master record to be deleted and does not affect associated detail records in the database.

Cascading Allows the master record to be deleted and automatically deletes any associated detail records in the detail block's base table at commit time. In a master-detail-detail relation, where relations are nested, only records in the immediate detail block are deleted (deletions do not cascade to multiple levels of a relation chain automatically).
Re: unable to delete master which has detail [message #315930 is a reply to message #245814] Wed, 23 April 2008 04:56 Go to previous messageGo to next message
sweetkhaliq
Messages: 200
Registered: April 2006
Senior Member

Quote:

(deletions do not cascade to multiple levels of a relation chain automatically).


Please Tell me how we can acheive casecade on multiple levels.
Suppose we have a block1 master, block2 detail,block3 detail of detail block. All are with casecade option. how can we achieve that when master record is deleted all the detail record should also be deleted.
thanks
Re: unable to delete master which has detail [message #315970 is a reply to message #245789] Wed, 23 April 2008 06:37 Go to previous messageGo to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
I also had the same problem
and still unable to find the solution
Re: unable to delete master which has detail [message #316012 is a reply to message #315930] Wed, 23 April 2008 08:50 Go to previous messageGo to next message
annagel
Messages: 220
Registered: April 2006
Senior Member
Well all the cascading option does it auto-create a PRE-DELETE trigger for each of the blocks so that it's sub-block gets deleted as well. The problem I believe is that these sub-deletes are SQL deletes and will not envoke the PRE-DELETE trigger on the first sub-block which would delete the second sub-block.

You should simply be able to modify the PRE-DELETE trigger on the top level block to delete the bottom level records before it deletes the mid level.
Re: unable to delete master which has detail [message #316914 is a reply to message #315970] Mon, 28 April 2008 19:43 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you all solved your problems?

David
Re: unable to delete master which has detail [message #317202 is a reply to message #316914] Tue, 29 April 2008 23:35 Go to previous message
sweetkhaliq
Messages: 200
Registered: April 2006
Senior Member

Yes DJMartin

I have found two solution
(1) As previous stated that modify the PRE-DELETE trigger on the top level block to delete the bottom level records before it deletes the mid level.

(2) Add database level before delete traiger on block2 table "detail table" to delete the "detail of detail" block3;

Thanks for Help
Previous Topic: FILE_OPEN_DIALOG question
Next Topic: purchase order numbers
Goto Forum:
  


Current Time: Sun Feb 09 05:10:12 CST 2025