nerdexam
Salesforce

PDI · Question #143

The following automations already exist on the Account object: - A workflow rule that updates a field when a certain criteria is met - A custom validation on a field - A How that updates related conta

The correct answer is D. The trigger may fire multiple times during a transaction.. When testing an Account trigger, developers must consider that a single DML operation can cause the trigger to fire multiple times within a transaction due to subsequent record updates by other automations like workflow rules or flows.

Submitted by olafpl· Apr 18, 2026Logic and Process Automation

Question

The following automations already exist on the Account object:

  • A workflow rule that updates a field when a certain criteria is met
  • A custom validation on a field
  • A How that updates related contact records

A developer created a trigger on the Account object. What should the developer consider while testing the trigger code?

Options

  • AThe flow may be launched multiple times.
  • BWorkflow rules will fire only after the trigger has committed all DML operations to the database.
  • CA workflow rule field update will cause the custom validation to run again.
  • DThe trigger may fire multiple times during a transaction.

How the community answered

(49 responses)
  • A
    4% (2)
  • B
    12% (6)
  • C
    8% (4)
  • D
    76% (37)

Why each option

When testing an Account trigger, developers must consider that a single DML operation can cause the trigger to fire multiple times within a transaction due to subsequent record updates by other automations like workflow rules or flows.

AThe flow may be launched multiple times.

While a flow can be launched, the primary consideration for a trigger is its own re-execution due to platform automation, rather than the flow itself launching multiple times which is a separate behavior.

BWorkflow rules will fire only after the trigger has committed all DML operations to the database.

Workflow rules fire after `before` and `after` triggers and *before* committing all DML operations; their field updates can cause triggers to re-fire, not only after commitment.

CA workflow rule field update will cause the custom validation to run again.

A workflow rule field update can cause a validation rule to run again, but the question asks what the developer should consider while testing the *trigger code* itself, focusing on trigger behavior.

DThe trigger may fire multiple times during a transaction.Correct

Due to Salesforce's order of execution, subsequent updates by workflow rules or flows within the same transaction can cause the initial trigger to fire again, which is crucial for developers to consider during testing to prevent unintended side effects.

Concept tested: Salesforce trigger order of execution

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm

Topics

#Apex Triggers#Order of Execution#Trigger Recursion#Salesforce Automation

Community Discussion

No community discussion yet for this question.

Full PDI Practice