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
Kenji775Kenji775 

Apex Trigger Execution Order

Hey all.

Is execution of triggers on the same object just based on the type of update, then the name of the trigger? Is there a way to control this? My first thought was to have one trigger per object, then from that trigger call the associated code/classes in the order I want, but that would require quite a bit of a rewrite I think. Any other way to control the order of execution?

Best Answer chosen by Admin (Salesforce Developers) 
DonSpilkyDonSpilky

beyond "before" and "after" trigger types, you can not control the order of execution of triggers.  If you need to chain events, your initiating trigger should call methods in the order that they are required.

All Answers

DonSpilkyDonSpilky

beyond "before" and "after" trigger types, you can not control the order of execution of triggers.  If you need to chain events, your initiating trigger should call methods in the order that they are required.

This was selected as the best answer
Kenji775Kenji775

Ok, thats cool. I'll begin refactoring my code to have a single trigger that calls the required methods. Thank you.