0
votes

I have two custom objects parent and child. If I delete parent record, the child records related to parent record should not delete. In the same if I delete the records from the related list of a parent record the records should not delete from the child object. How can I achieve this? Can any one give me code for overriding the delete button..... Any suggestions/hints could be appreciated.

1
Put some code which have you tried.. - Barlas Apaydin
Very likely you really do not want parent child relationship here. Use lookup field to link the two objects. - dipu

1 Answers

1
votes

This is the expected behavior in a master-detail relationship. A child MUST have a parent. One option you might consider is the new "reparent" option in Summer '12 that you can set on the child object. This way, you could move the children to another parent before you delete the original parent.