+ Start a Discussion

how to set which trigger to execute first

what if i have 5 triggers on Object1__c, how can i set which of the five triggers to execute first? is it possible?

The order of execution isn’t guaranteed when having multiple triggers for the same object due to the same event. For example, if you have two before insert triggers for Case, and a new Case record is inserted that fires the two triggers, the order in which these triggers fire isn’t guaranteed.

Reference: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm
What you can do instead is create a class that contains all of your triggers code. Then have a single calling each methods one by one.
Have a look at this : 
Saravanan @CreationSaravanan @Creation

As Vinit said the order of execution if you have multiple Trigger on single object. So the best solution and also the best practice of salesforce 
is for an object there should be only one trigger.

In that based on trigger event you can control the order the exectuing your own methods.