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
TheRealistTheRealist 

Does after trigger works only when we need to perform a DML operation on a related object ?

Does after trigger works only when we need to perform a DML operation on a related object due to certain dml operation occured on the current object when only both are involed a relationship or can we use after trigger events on a single object itself.
viruSviruS
you can use for single object itself .. let me know about your exact requirement
Himanshu ParasharHimanshu Parashar
Hi,

yes that is correct, we generally use that to update related object because current record comes in read only mode so you can't update current record. It would be great if you can describe your requirement.

Thanks,
Himanshu
TheRealistTheRealist
Thanks @viruS and @himanshu parashar, i am clear about the before triggers on a single object but i wonder what is the need of defining after trigger on a single object if it does not have any relationship with another object and in what type of situations we can use after triggers on a single object(not related to any object in any way) and what things can be achieved by doing so.