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?
- The before-save record-triggered flow executes first, followed by the custom validation rule.Answer
- BThe custom validation rule executes first, followed by the before-save record-triggered flow.
- CThe custom validation rule executes first, followed by Case assignment rules and then the before-save flow.
- DWorkflow 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
Key Concept
Order of Execution: Before-Save Flows vs Custom Validation Rules