An administrator is building an autolaunched flow that updates the Status field to 'Waitlisted' across all related Conference Registration records whenever a Conference session reaches maximum capacity.
What should the administrator do to update the records efficiently while respecting governor limits?
- AIterate through the retrieved registration collection using a Loop element, and place an Update Records element inside the loop to update each record individually.
- Iterate through the registration collection with a Loop element, modify the Status in an Assignment element, add each updated record to a second collection variable, and use a single Update Records element after the loop finishes.Answer
- CConfigure a before-save record-triggered flow on the parent Conference object to directly update the child Conference Registration records before the session record is committed to the database.
- DUse a single Assignment element directly after the Get Records element to update the Status field across the entire record collection without looping, then rely on system validation rules to commit the changes.
Answer
Iterate through the retrieved registration records with a Loop element, update the record variable in an Assignment element, add each record to a new collection variable in a second assignment, and execute a single Update Records element after the loop completes.
Salesforce best practice requires bulkifying flow logic. When updating multiple child records, an administrator should loop through the records, modify fields on the loop variable, append each modified record to a separate collection variable using an Assignment element, and execute a single Update Records element after the loop has finished.
Step-by-Step Solution
Key Concept
Flow bulkification design pattern using Loop, Assignment, and Collection variables
Estimated Time:1m 15s