Question

Difficulty: MediumOrder of Execution and Automation Considerations

An administrator at Northern Trail Outfitters configured a Before-Save Record-Triggered Flow (Fast Field Update) on the Opportunity object to automatically populate the `Discount_Percentage__c` field with a default value of 10% whenever it is left blank upon creation. Additionally, an active Custom Validation Rule on Opportunity blocks saving any record where `Discount_Percentage__c` is null.

If a sales representative creates a new Opportunity and leaves the `Discount_Percentage__c` field blank, what will occur when the record is saved?

  1. A
    The save operation fails with a validation error because Custom Validation Rules execute before Before-Save Record-Triggered Flows.
  2. The Opportunity is saved successfully because the Before-Save Record-Triggered Flow populates the field before Custom Validation Rules are evaluated.Answer
  3. C
    The Opportunity is saved successfully because Before-Save Record-Triggered Flows automatically bypass all Custom Validation Rules.
  4. D
    The save operation fails because field modifications on the triggering record can only be executed by After-Save Flows.

Answer

The Opportunity is saved successfully because the Before-Save Record-Triggered Flow populates the field before Custom Validation Rules are evaluated.
In the Salesforce Order of Execution, Before-Save Record-Triggered Flows (Fast Field Updates) execute before Apex before triggers and before Custom Validation Rules. When the user leaves the field blank, the Before-Save Flow populates `Discount_Percentage__c` with 10% first. When the Custom Validation Rule evaluates subsequently, the field is no longer blank, allowing the record to save successfully.

Step-by-Step Solution

1
Identify the automation components involved and their execution timing.
The scenario involves a Before-Save Record-Triggered Flow (Fast Field Update) and a Custom Validation Rule on the same object.
Salesforce processes automated events during a save operation according to a strict Order of Execution.
2
Determine the sequence between Before-Save Record-Triggered Flows and Custom Validation Rules.
Before-Save Record-Triggered Flows execute in step 3/4 of the Order of Execution, whereas Custom Validation Rules execute in step 6 (after Apex before triggers).
Fast Field Updates occur in memory prior to running custom validation logic and writing the record to the database.
3
Evaluate the record values when validation rules execute.
The Before-Save Flow sets `Discount_Percentage__c` to 10% in memory; when the Custom Validation Rule evaluates whether `Discount_Percentage__c` is null, the condition evaluates to false.
Validation rules evaluate the current state of the record, including any modifications applied by before-save automation.

Key Concept

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