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

Execution order of Triggers.


I have a scenario of execution of triggers order where one trigger need to be executed before the other one.


I have 4 "before insert" triggers on opportunity. On what basis the order of execution depends on?

Can I decide the order of execution?





No, you can't pre-determine or force the order of the execution. I recommend moving the logic in an Apex class (or set of classes) and only have 1 trigger on Opportunity. From inside the trigger you can control the order the apex class methods are invoked.