function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TesterInSkyTesterInSky 

delete a parent-role sObject, its children will also be deleted?

I am doing some testing on my side.

I noticed that if I delete an Account, then the Contacts belong to it will also be deleted. But for custom sObject, the one with look-up field created on it, if I delete the parent sObject, the children attached to it seems not deleted.

Is this a difference between standard sObjects and custom sObjects?

I also found this in document:
"Lookup
This type of relationship links two objects together, but it has no effect on deletion, record ownership, or security"
rpr2rpr2
Account and Contacts have a master-detail relationship, which is the reason contacts get deleted when you delete the account.  Same is true for custom objects with a master-detail relationship.  Lookup relationships can occur between standard and custom objects and the lookup record does not get deleted when the record it is related to is deleted.
 
This link to overview of relationships in online help explains more:  https://cs2.salesforce.com/help/doc/en/overview_of_custom_object_relationships.htm
 
onedayoneday
Your are right, I have read the related part of the document.

Thank you!