New Child Records Orphaned

Discussion created by Vinny on Apr 20, 2017
Latest reply on Apr 21, 2017 by Vinny



I have customers and contacts.  Contacts are children of customers by way of a FK relationship to the parent customer.


I have the relationship set up so that if a customer is deleted, it also deletes any children (contacts).


However, if a user creates a new contact that has not been committed (record state 1), and before he/she commits, another user deletes the parent, then we end up with an orphaned record.


I can't commit the child record upon creation to lock in the FK relationship because I have field validation going on.


I might be able to find a way to open the parent record and protect it from being deleted by another user while the user is creating a child record.


I could also do something in the child OnRecordCommit to check if it still has a parent, and if not, inform the user that the child will be deleted.


How are people handling this???