Question

Difficulty: MediumOrder of Execution and Automation Considerations

An administrator at an energy services firm is configuring automation for a custom Project_Milestone__c object. The configuration includes custom validation rules, duplicate rules, a before-save record-triggered flow (fast field update), and an after-save record-triggered flow. When a user creates and saves a new Project_Milestone__c record, which two statements correctly describe how Salesforce evaluates these automation components in the order of execution? (Select two.)

  1. The before-save record-triggered flow updates field values on the record prior to the evaluation of custom validation rules.Answer
  2. Custom validation rules execute before the record is saved to the database and before after-save record-triggered flows run.Answer
  3. C
    Custom validation rules evaluate prior to the execution of the before-save record-triggered flow.
  4. D
    The after-save record-triggered flow executes before the record is initially saved to the database and before duplicate rules run.
  5. E
    Duplicate rules are evaluated before the before-save record-triggered flow executes.

Answer

The before-save record-triggered flow updates field values prior to the evaluation of custom validation rules, and custom validation rules evaluate before the record is written to the database and before after-save flows execute.
In the standard Salesforce order of execution on save, before-save record-triggered flows (fast field updates) execute before custom validation rules. Custom validation rules and duplicate rules are then evaluated prior to the initial database save, while after-save record-triggered flows execute later in the process after the record has been written to the database.

Step-by-Step Solution

1
Analyze the position of Before-Save Record-Triggered Flows in the order of execution.
Before-save flows execute immediately after system validation (required fields/layout checks) and before Apex before triggers and custom validation rules.
Fast field updates are designed to modify the triggering record in-memory before validation and database persistence.
2
Analyze the position of Custom Validation Rules and Duplicate Rules.
Custom validation rules run after before-save flows; duplicate rules run immediately following custom validation rules.
Salesforce validates the modified record data before verifying duplicate rules and saving the record to the database.
3
Analyze the position of After-Save Record-Triggered Flows.
After-save flows run late in the sequence, after the record is saved to the database, after triggers, assignment rules, auto-response rules, and workflow rules.
After-save automations are intended for cross-object updates and accessing the newly assigned record ID.

Key Concept

Salesforce Order of Execution sequence between Before-Save Flows, Custom Validation Rules, and After-Save Flows
Estimated Time:1m 15s
Rate this question