Question

Difficulty: EasyOrder of Execution and Automation Considerations

An administrator is setting up automation on the Opportunity object. A before-save record-triggered flow is configured to automatically update a field value, while a custom validation rule is also enabled on the object to check for required inputs upon saving. When a record is updated and saved, which of the following executes first according to the Salesforce order of execution?

  1. Before-save record-triggered flowAnswer
  2. B
    Custom validation rules
  3. C
    After-save record-triggered flow
  4. D
    Workflow rules

Answer

The before-save record-triggered flow executes first.
In the Salesforce order of execution, before-save record-triggered flows (and Apex before triggers) execute prior to custom validation rules. This design ensures that field modifications made automatically by before-save automation are checked by custom validation rules before data is saved to the database.

Step-by-Step Solution

1
Evaluate the order of execution steps when a record is saved.
System checks load field values into memory.
Initial record state is established before running user-defined automation.
2
Determine when before-save automation runs relative to validation rules.
Before-save record-triggered flows execute before custom validation rules.
Salesforce runs before-save flows and Apex before triggers first so field changes made by before-save logic can be validated by custom validation rules later in the sequence.

Key Concept

Salesforce Order of Execution sequence between flows and validation rules
Rate this question