Soru

Zorluk: ZorFlow Builder Elements and Logic

Cloud Kicks wants to automatically update the Status of all open child Cases to 'Escalated' whenever a parent Account's Type is changed to 'Enterprise'. An administrator is designing a Record-Triggered Flow on the Account object to handle this requirement for accounts that may have hundreds of associated Cases. Which combination and sequence of Flow elements should the administrator use to accomplish this while adhering to Salesforce governor limit best practices?

  1. Use a Get Records element to store the open Cases in a collection variable, iterate through the collection using a Loop element, use an Assignment element inside the loop to set the Status field and append each updated Case to a new record collection variable, and execute a single Update Records element with the new collection outside the loop.Cevap
  2. B
    Use a Get Records element to fetch the open Cases, iterate through them with a Loop element, and place an Update Records element directly inside the loop to set the Status field to 'Escalated' on each Case record during iteration.
  3. C
    Create a Roll-Up Summary field on the Account object to aggregate the child Cases, and use an Assignment element in the flow to update the Case Status field directly through the parent account record.
  4. D
    Use a Decision element inside a Loop element to evaluate the Case Record Type, and assign updated picklist values directly without performing a Get Records or Update Records data manipulation step.

Cevap

The administrator should use a Get Records element to retrieve open Cases into a collection, use a Loop element with an Assignment element to modify field values and append each record to a new collection variable, and place a single Update Records element outside the loop.
To process multiple child records safely without exceeding Salesforce governor limits, Flow Builder elements must be bulkified. The correct approach uses a Get Records element to store child records in a collection, iterates through them with a Loop element while updating field values in memory using Assignment elements, and completes the operation with a single Update Records element placed outside the loop.

Adım Adım Çözüm

1
Retrieve related child records into a collection variable
A record collection variable containing all open Cases associated with the triggering Account is created using a single Get Records element.
Bulk processing requires gathering child records prior to iteration.
2
Iterate and update in-memory variables using Loop and Assignment elements
Field values are updated on individual loop item variables and added to a target update collection variable.
Manipulating record variables in memory avoids executing database calls inside the loop.
3
Persist changes to the database using an Update Records element outside the loop
All modified Case records in the target collection are updated in a single bulk DML operation.
Executing DML elements outside of loops prevents hitting Apex governor limits.

Anahtar Kavram

Flow Builder Bulkification and Element Logic
Bu soruyu puanla