An administrator needs to build an autolaunched flow that processes a list of active Subscription records associated with an Account when its tier is updated. The flow retrieves the related records into a Record Collection Variable and needs to modify the renewal date field on each record in the collection. Which design pattern should the administrator implement to perform this data manipulation while strictly adhering to Salesforce governor limits?
- Use a Loop element to iterate over the collection, update the current loop item's renewal date via an Assignment element, append the updated item to a new Record Collection Variable via a second Assignment element, and place a single Update Records element after the loop.Cevap
- BUse a Loop element to iterate over the collection, set the renewal date on the current loop item using an Assignment element, and place an Update Records element inside the loop to persist changes immediately for each record.
- CUse a Loop element containing a Get Records element to re-query each Subscription record individually, update the renewal date, and execute an Update Records element before proceeding to the next iteration.
- DPlace an Update Records element directly inside the Loop element referencing the original Record Collection Variable without using any Assignment elements.
Cevap
The administrator should iterate through the retrieved collection with a Loop element, update the field values on the current loop record using an Assignment element, add the modified record to a secondary Record Collection Variable using another Assignment element, and execute a single Update Records element on the secondary collection outside of the loop.
The correct pattern follows Salesforce bulkification standards for Flow Builder. Modifying record values in memory via Assignment elements and storing them in a collection variable allows all database updates to be committed using a single Update Records DML operation after the loop finishes executing.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification with Assignment Elements and Record Collections
Tahmini Süre:2m 0s