Soru

Zorluk: OrtaOrder of Execution and Automation Considerations

A manufacturing company processes warranty claims on a custom object called Warranty_Claim__c. The Salesforce system is configured with the following automation components:

• A Fast Field Update (before-save) Record-Triggered Flow that assigns the Claim_Tier__c field to 'Tier 1' when the Claim_Amount__c exceeds $5,000.
• A custom Validation Rule requiring the Claim_Tier__c field to be populated before saving.
• An Actions and Related Records (after-save) Record-Triggered Flow that assigns an inspection task to the service manager whenever a claim is categorized as 'Tier 1'.

A service agent creates a new Warranty_Claim__c record with a Claim_Amount__c of $6,500 and leaves the Claim_Tier__c field blank. What outcome occurs during the save operation?

  1. The record saves successfully because the Fast Field Update flow populates the required field before custom validation rules execute, and the after-save flow creates the inspection task.Cevap
  2. B
    The transaction fails with a validation error because custom validation rules evaluate initial user input before any record-triggered flows are triggered.
  3. C
    The record saves, but the custom validation rule is permanently bypassed because record-triggered flows run exclusively in system context after the database commit.
  4. D
    The transaction fails because the Actions and Related Records flow executes first and attempts to create a task for an unvalidated record.

Cevap

The record saves successfully because the Fast Field Update flow populates the required field before custom validation rules execute, and the after-save flow creates the inspection task.
According to the Salesforce Order of Execution, Fast Field Update (before-save) record-triggered flows run early in the save cycle, before custom validation rules. Because the before-save flow assigns 'Tier 1' to the Claim_Tier__c field, the validation rule requirement is satisfied when evaluated. Following the save to the database, the Actions and Related Records (after-save) flow executes to generate the related task.

Adım Adım Çözüm

1
Evaluate initial record load and Fast Field Updates execution
Salesforce loads the new record values into memory and executes the Fast Field Update (before-save) Record-Triggered Flow.
In the Salesforce order of execution, before-save record-triggered flows execute immediately after initial system validations and before Apex before triggers and custom validation rules.
2
Evaluate Custom Validation Rules against updated record state in memory
The Claim_Tier__c field is already set to 'Tier 1' in memory by the before-save flow, so the custom validation rule passes.
Custom validation rules evaluate the modified state of the record after before-save flows and Apex before triggers have updated fields.
3
Save record to database and execute After-Save Automations
The record is saved to the database, and the Actions and Related Records (after-save) flow executes, creating the related task.
After-save record-triggered flows fire after the record is saved to the database, following triggers, assignment rules, auto-response rules, and workflow rules.

Anahtar Kavram

Salesforce Order of Execution: Fast Field Updates (Before-Save Flows) run prior to Custom Validation Rules, which run prior to Actions and Related Records (After-Save Flows).
Tahmini Süre:1m 15s
Bu soruyu puanla