Soru

Zorluk: Çok zorFlow Builder Elements and Logic

An organization tracks custom Project Milestone records linked to a parent Project object through a Lookup relationship. When a Project Milestone status changes to 'Completed', an administrator must update the parent Project's aggregated completion percentage and update a custom status field on all related open Project Task records. The automation must handle bulk data uploads of up to 200 Project Milestones simultaneously without exceeding transaction limits. Which Flow Builder design strategy correctly processes these record updates while adhering to Salesforce governor limits?

  1. A
    Create a Roll-Up Summary field on the parent Project object to calculate the total completed milestone weighting automatically, eliminating the need to query or loop over child milestone records in Flow Builder.
  2. Use a Get Records element outside the loop to retrieve all related milestones, iterate through the collection with a Loop element using an Assignment element to sum the completion weighting into a variable, and execute a single Update Records element after loop execution finishes.Cevap
  3. C
    Iterate through each related Project Task inside a Loop element and place an Update Records element within the loop body to modify each task individually as it is processed.
  4. D
    Use a Loop element to update each Project Task's record type assignment directly by setting a custom picklist field value without verifying if the picklist value is assigned to that target Record Type.

Cevap

The administrator should perform data calculations in memory using a Loop and Assignment element, placing the Update Records element after the loop completes to execute a single bulkified DML operation.
Bulkifying a Flow requires isolating database interactions (Get Records, Update Records, Create Records, Delete Records) outside of Loop elements. By collecting data into memory, using Assignment elements within the loop to calculate totals or build record collections, and invoking a single Update Records element after the loop completes, the flow handles bulk operations efficiently within governor limits.

Adım Adım Çözüm

1
Evaluate relationship constraints
Confirm that because the parent Project is connected via a Lookup relationship (not Master-Detail), standard Roll-Up Summary fields cannot be created on the parent object.
Roll-Up Summary fields are exclusively available for Master-Detail relationships.
2
Design data retrieval and iteration logic
Use a single Get Records element prior to entering the loop to fetch all child milestone records into a Record Collection variable.
Fetching collection data before looping avoids executing SOQL queries inside a loop iteration.
3
Perform aggregation in memory
Iterate over the collection with a Loop element and add values to an aggregation variable using an Assignment element.
Assignment elements modify variables in memory and do not consume DML or SOQL governor limits.
4
Execute database updates outside the loop
Place the Update Records element on the path exiting the loop ('After Last Item').
Consolidating DML operations into a single database update outside the loop ensures the flow stays within governor limits during bulk transactions.

Anahtar Kavram

Flow Bulkification and Governor Limits
Bu soruyu puanla