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
Ranadheer chRanadheer ch 

How to control the excution of 2 triggers ...so here

How to control the excution of 2 triggers ...so here i have 3 triggers for an object ..so here i want to control those  triggers excution order...for example i have trigger1,trigger2,trigger3..........here what i need is first trigger2 should fire, after that trigger1 should fire, finally trigger3 should fire ...how can i achive that ? this is actually my interview question....help me ...thanks in advance
John PipkinJohn Pipkin
You cannot control the execution of triggers (if multiple before or after  triggers exist for the same object). The only way to ensure the code gets executed in order is to only have 1 before and 1 after trigger per object. So the answer I would give is to combine the triggers. See this article for more detailed info about Order of Execution: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm

Hope that helps