PDI · Question #104
Which statement describes the execution order when trigger are associated to the same object and event?
The correct answer is B. Trigger execution order cannot be guaranteed. When multiple Apex triggers are associated with the same object and event, Salesforce does not guarantee a specific execution order.
Question
Which statement describes the execution order when trigger are associated to the same object and event?
Options
- ATriggers are executed in the order they are created..
- BTrigger execution order cannot be guaranteed.
- CTriggers are executed in the order they are modified
- DTriggers are executed alphabetically by trigger name.
How the community answered
(38 responses)- A3% (1)
- B87% (33)
- C3% (1)
- D8% (3)
Why each option
When multiple Apex triggers are associated with the same object and event, Salesforce does not guarantee a specific execution order.
Salesforce does not guarantee that triggers will execute in the order they were created.
Salesforce explicitly states that the order of execution for multiple triggers on the same object and event (e.g., before insert, after update) cannot be guaranteed and developers should design triggers to function independently.
Salesforce does not guarantee that triggers will execute in the order they were modified.
Salesforce does not guarantee that triggers will execute alphabetically by trigger name.
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.