Question

Difficulty: EasyOrder of Execution and Automation Considerations

An organization relies on several automation and data quality features on the Case object. A Salesforce administrator has configured both a custom validation rule and a before-save record-triggered flow on the Case object. When a user updates and saves a Case record, which sequence describes the correct order of execution?

  1. The before-save record-triggered flow executes first, followed by the custom validation rule.Answer
  2. B
    The custom validation rule executes first, followed by the before-save record-triggered flow.
  3. C
    The custom validation rule executes first, followed by Case assignment rules and then the before-save flow.
  4. D
    Workflow rules execute first, followed by the custom validation rule and before-save record-triggered flow.

Answer

The before-save record-triggered flow executes first, followed by the custom validation rule.
During the Salesforce record save process, before-save record-triggered flows execute very early, prior to Apex before triggers and custom validation rules. This allows any field values updated by the before-save flow to be evaluated by custom validation rules before the record is saved to the database.

Step-by-Step Solution

1
Identify the automation features being evaluated during record save.
The features present are a before-save record-triggered flow and a custom validation rule.
Determining which elements exist helps locate their respective positions in the Salesforce save order of execution.
2
Evaluate the standard Salesforce order of execution sequence.
Before-save record-triggered flows execute early in the sequence (before Apex before triggers and custom validation rules). Custom validation rules evaluate after before-save flows.
This sequence ensures field values populated or changed by before-save automation can be checked by custom validation rules.

Key Concept

Order of Execution: Before-Save Flows vs Custom Validation Rules
Rate this question