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
Himanshu Verma 9Himanshu Verma 9 

Trigger on account deletion related contacts also delete

i want to write a trigger when i delete account related contacts also get deleted,please help me
Anupama SamantroyAnupama Samantroy
Account and Contact have a standard relationship which is combination of lookup and master detail. But when you delete the account the contacts are deleted.
Contacts and Accounts have a lookup relationship but this relationship has a property called CascadeDelete set to true. This is why the contact is deleted when the parent object is deleted.

Thanks
Anupama
Anupama SamantroyAnupama Samantroy
If your question is solved then request you to close this thread
Himanshu Verma 9Himanshu Verma 9
no i can't bcoz how to map the id with contact with account
 
Anupama SamantroyAnupama Samantroy
The contact will have the lookup to account right? So when you delete the account the contacts are also deleted.
Himanshu Verma 9Himanshu Verma 9
yes that's requirement