An organization is optimizing its automation architecture for a custom object named Inspection__c. When an Inspection__c record is modified and marked as 'Completed', the system must fulfill three specific requirements:
1. Calculate and populate the Internal_Compliance_Code__c field directly on the triggering Inspection__c record prior to committing changes to the database.
2. Update the Total_Inspections__c counter on the related parent Facility__c record.
3. Send an HTTP web request to an external auditing endpoint to log the completion event.
Which automation design best adheres to Salesforce performance best practices while minimizing transaction overhead and avoiding governor limit exceptions?
- Implement a Fast Field Updates (Before-Save) record-triggered flow to update the Internal_Compliance_Code__c on the triggering record, and an Actions and Related Records (After-Save) record-triggered flow featuring an Asynchronous Path to update the parent Facility__c record and execute the external callout.Cevap
- BImplement a single Actions and Related Records (After-Save) record-triggered flow containing an Update Records element for the triggering Inspection__c record, an Update Records element for the parent Facility__c record, and an Apex action element for the external callout within the synchronous path.
- CImplement a Schedule-Triggered Flow running every hour that queries all Inspection__c records marked as 'Completed' within the last hour, updates the Internal_Compliance_Code__c and parent Facility__c records in a loop, and executes the external callout.
- DImplement a Fast Field Updates (Before-Save) record-triggered flow that assigns the Internal_Compliance_Code__c, performs a Get Records and Update Records on the parent Facility__c record, and triggers an Apex callout action.
Cevap
Implement a Fast Field Updates (Before-Save) record-triggered flow for same-record updates, alongside an Actions and Related Records (After-Save) record-triggered flow utilizing an Asynchronous Path for related record updates and external callouts.
The solution that combines a Fast Field Updates (Before-Save) record-triggered flow with an Actions and Related Records (After-Save) record-triggered flow utilizing an Asynchronous Path follows official Salesforce architectural best practices. Before-Save flows update fields on the triggering record without incurring DML overhead. After-Save flows handle related record updates and external callouts, while the Asynchronous Path isolates the callout to avoid 'uncommitted work pending' errors and separate governor limits.
Adım Adım Çözüm
Anahtar Kavram
Record-Triggered Flow Types, Execution Timing (Before vs. After Save), and Asynchronous Paths
Tahmini Süre:2m 0s