Soru

Zorluk: OrtaFlow Builder Elements and Logic

An automation specialist is designing an autolaunched flow in Flow Builder to update a custom field across a collection of renewal Contract records. The flow receives a collection variable containing multiple Contract records, needs to populate the Renewal_Manager__c field on each record in memory, and then commit all updates to the database. Which sequence of Flow elements and logic demonstrates the correct bulkified design pattern?

  1. Iterate over the Contract collection using a Loop element; inside the loop, use an Assignment element to update the field on the loop item variable, use a second Assignment element to add the loop item to a new collection variable, and place an Update Records element after the loop using the new collection variable.Cevap
  2. B
    Iterate over the Contract collection using a Loop element; inside the loop, use an Assignment element to set the field on the loop item variable, and place an Update Records element immediately after the Assignment element inside the loop.
  3. C
    Iterate over the Contract collection using a Loop element; inside the loop, use a Get Records element to fetch each Contract individually before applying an Assignment element, followed by an Update Records element placed outside the loop.
  4. D
    Configure a Roll-Up Summary field on the parent Account object to calculate and assign the Renewal_Manager__c value across all child Contract records automatically, omitting Loop and Assignment elements.

Cevap

Iterate over the Contract collection using a Loop element, assign updated values to individual items and push them to a output collection variable inside the loop, and execute a single Update Records element outside the loop.
The correct pattern for bulk record modifications in Flow Builder involves using a Loop element to iterate through records, Assignment elements inside the loop to modify field values and append each record to a output collection variable, and a single Update Records element outside the loop to execute a bulk update.

Adım Adım Çözüm

1
Loop through the input collection
Each record in the collection is processed individually in memory.
Looping allows field modifications on individual record variables without executing immediate database operations.
2
Assign updated field values and add to an output collection
The current loop item record variable has its Renewal_Manager__c field set, and the updated record is added to a separate output record collection variable.
Collecting modified items into a target collection variable prepares all updated records for a single bulk DML operation.
3
Execute Update Records element outside the loop
Salesforce updates all modified Contract records in the target collection variable in a single transaction step.
Placing data manipulation elements outside the loop ensures the flow executes only 1 DML statement regardless of collection size, respecting Salesforce governor limits.

Anahtar Kavram

Bulkification in Flow Builder using collections, loops, and assignment elements
Bu soruyu puanla