PDI · Question #166
which statement is true regarding execution order when triggers are associated to the same object and event?
The correct answer is A. Trigger execution order cannot be guaranteed. When multiple Apex triggers are associated with the same object and event, their execution order is not guaranteed by Salesforce.
Question
which statement is true regarding execution order when triggers are associated to the same object and event?
Options
- ATrigger execution order cannot be guaranteed.
- Bexecuted In the order they are modified.
- CTriggers are executed alphabetically by trigger name.
- DTriggers are executed in the order they are created.
How the community answered
(61 responses)- A92% (56)
- B2% (1)
- C5% (3)
- D2% (1)
Why each option
When multiple Apex triggers are associated with the same object and event, their execution order is not guaranteed by Salesforce.
Salesforce explicitly states that if you have multiple Apex triggers for the same object and same event, the order of execution is not guaranteed, and developers should use a single trigger per object and event with a handler class to manage logic order.
The order in which triggers are modified does not influence their execution order; Salesforce does not provide such a guarantee.
Trigger execution order is not determined by the alphabetical order of trigger names.
The creation date of a trigger does not determine its execution order relative to other triggers on the same object and event.
Concept tested: Apex Trigger Execution Order
Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
Topics
Community Discussion
No community discussion yet for this question.