+ Start a Discussion
Eran VizelEran Vizel 

Triggers order of execution


If I put 2 triggers on same object, and they both set to run on same event (before insert), how can I tell and/or decide which one of them will run first?

Thank you,
Niket SFNiket SF
Hi Eran,

 There is no any specific assurance that which trigge wil fire first. Its better to to twrite one trigger and call two different handlers which will handle your two different use cases.

Shikha AgashiShikha Agashi
Combine both trigger in single Helper Class and define two different method in it. Call this methods in Helper Class as you want to excute the logic.

For example, you have trigger A and Trigger B. If you want to execute first triggerB and then trigger A.

trigger executePattern on Object(Before Insert){ // Mention all the event  


Helper Class:

public class executePatternHelperClass{
public static void BeforeEvent( List<sobject> newMap){

public void methodA(){
   //your logic from triggerA
public void methodB(){
   //your logic from Trigger B
Eran VizelEran Vizel
Got ya,

Thank you for your replies!