Soru

Zorluk: KolayFlow Builder Elements and Logic

A Salesforce Administrator needs to build an autolaunched flow that updates a field on all Contact records related to an Account while adhering to Salesforce bulkification best practices. In what order should the administrator configure the Flow Builder elements to process these records without exceeding governor limits?

  1. 1Get Records element to query all related Contact records into a record collection variable
  2. 2Loop element to iterate over each Contact record in the retrieved collection variable
  3. 3Assignment element inside the loop to update the field value on the current loop record item
  4. 4Assignment element inside the loop to add the updated current loop record item to a new output record collection variable
  5. 5Update Records element outside the loop to update the new output record collection variable in a single operation

Cevap

The correct sequence is: Get Records element to query related records -> Loop element to iterate through the collection -> Assignment element to update field values on the current item -> Assignment element to add the current item to a new collection -> Update Records element outside the loop to execute the bulk update.
The correct order demonstrates proper bulkification in Flow Builder. The flow queries records once using a Get Records element, iterates through them in a Loop element, uses Assignment elements to update field values and collect modified records into a new collection, and finally performs a single Update Records element outside the loop to commit all changes efficiently.

Adım Adım Çözüm

1
Retrieve data using a Get Records element
Contact records are retrieved into a record collection variable.
Data must be loaded into memory before processing.
2
Iterate using a Loop element
The flow begins evaluating records one by one.
A loop provides access to each record's fields individually.
3
Modify fields using an Assignment element inside the loop
Field values on the current record item variable are updated.
Field changes must be assigned to the loop variable in memory.
4
Add the updated record to a new collection using an Assignment element inside the loop
The modified record is appended to an update collection variable.
Staging records in a collection allows for a single bulk DML update.
5
Execute DML using an Update Records element outside the loop
All records in the update collection are saved to the database in one DML statement.
Placing database operations outside the loop prevents hitting Salesforce DML governor limits.

Anahtar Kavram

Flow Bulkification Best Practices
Tahmini Süre:1m 0s
Bu soruyu puanla