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
AshlekhAshlekh 

Which trigger execute if there are more than one trigger on Opportunity.

Hi All,

I want to know that which trigger will fire if there are more than one trigger has written on opporutnity?

Trigger first was written in 2014 and Trigger second was written in 2015 on opportunity.



-Thanks
Ashlekh Gera
Amit Chaudhary 8Amit Chaudhary 8
Order will not fixed for trigger. If you want to fix the order of trigger then create one trigger per object and use trigger framework to define the order.
Please check below post for more help
1) http://amitsalesforce.blogspot.in/2015/06/trigger-best-practices-sample-trigger.html

1) One Trigger Per Object
A single Apex Trigger is all you need for one particular object. If you develop multiple Triggers for a single object, you have no way of controlling the order of execution if those Triggers can run in the same contexts

2) Logic-less Triggers
If you write methods in your Triggers, those can’t be exposed for test purposes. You also can’t expose logic to be re-used anywhere else in your org. 

3) Context-Specific Handler Methods
Create context-specific handler methods in Trigger handlers

Let us know if this will help you

Thanks
Amit Chaudhary