An administrator is building an autolaunched flow to update the status of all active Software License records to 'Inactive' whenever a parent Contract record is marked as 'Expired'. The flow must handle bulk updates safely without exceeding Salesforce governor limits. Which two design practices should the administrator implement in the flow design?
- Use a Get Records element before the Loop element to retrieve all related active Software License records into a record collection variable.Cevap
- Use an Assignment element inside the Loop element to add modified record variables to a record collection variable, then use a single Update Records element after the loop.Cevap
- CPlace an Update Records element inside the Loop element to save changes to each Software License record immediately during each iteration.
- DPlace a Get Records element inside the Loop element to query the latest field values for each Software License record individually.
Cevap
The administrator should retrieve all related records into a record collection variable using a single Get Records element before entering the loop, and use an Assignment element inside the loop to accumulate modified records into a collection variable before executing a single Update Records element after the loop.
Bulkifying flows requires moving database interactions (SOQL queries and DML operations) outside of loops. Retrieving records into a collection before the loop executes a single query, and accumulating modified record variables into a collection variable to update with a single Update Records element after the loop minimizes transaction overhead and adheres to Salesforce governor limits.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Governor Limits