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
ch ranjithch ranjith 

If one object in Salesforce have 2 triggers which runs “before insert”. which one will be executed first? Is there any way to control the sequence of execution of these triggers?

Best Answer chosen by ch ranjith
logontokartiklogontokartik
If you write two triggers, there is no particular order of execution and one might run first and sometimes second. In order to control the triggers order of execution, many experts have built Trigger Templates,that basically allow developers to control the order of execution and also control when the trigger needs to be fired. Please take a look at the below blog, you can even search for "Trigger Template" and get many other posts

http://www.tgerm.com/2012/01/salesforce-apex-trigger-template.html