An administrator needs to build an autolaunched Flow that updates the Mailing Street address on all Contact records associated with a modified Account record. To strictly comply with Salesforce apex governor limits, in what sequence should the administrator configure the Flow resources and elements to perform this data manipulation?
- 1Execute a Get Records element to query all Contact records related to the Account ID into a record collection variable.
- 2Pass the record collection variable into a Loop element to process each Contact record individually.
- 3Use an Assignment element within the loop to update field values on the current item loop variable.
- 4Use a second Assignment element within the loop to add the updated current item loop variable to a separate update collection variable.
- 5Place an Update Records element on the After Last loop path to persist the update collection variable to the database.
Cevap
The correct sequence starts with querying records using a Get Records element into a collection, iterating through the collection with a Loop element, modifying fields on the current loop item via an Assignment element, adding the modified item to an update collection variable via a second Assignment element inside the loop, and finally executing a single Update Records element after the loop completes.
Bulkifying Salesforce Flows requires separating memory-based data manipulation from database operations. The proper architecture performs a single Get Records query before entering the Loop, uses Assignment elements inside the loop to alter values and stage items into a new collection variable in memory, and finishes with a single Update Records element placed after the loop path completes.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Collection Data Manipulation