What is the difference between before delete and after delete trigger Salesforce?

1.4K    Asked by Diyatomar in Salesforce , Asked on May 8, 2023

For Apex triggers, the before and after contexts for insert and update operations makes sense in that the records can be modified during before and not during after.


In the case of delete operations, what exactly is different between before delete and after delete? In other words, if I'm designing a trigger to run when records are deleted, what information should I take into consideration when choosing to attach the trigger to before delete or to after delete?


Answered by Dipesh Bhardwaj

On the after delete trigger Salesforce you can block the deletion. On the before delete you can perform other cascading deletes, for instance.


Your Answer

Interviews

Parent Categories