Soru

Zorluk: OrtaFlow Builder Elements and Logic

An administrator is building an autolaunched flow to update the Stage of all open Renewal Opportunities associated with an Account whenever the Account's service tier changes. To ensure the flow adheres to Salesforce governor limits and bulkification best practices, which two elements or design choices should the administrator include in the flow logic?

  1. An Assignment element inside the loop that adds each modified Opportunity record to a record collection variable.Cevap
  2. B
    An Update Records element placed inside the loop to update each Opportunity record immediately after its stage is modified.
  3. A single Update Records element positioned outside and after the loop to update the record collection variable.Cevap
  4. D
    A Roll-Up Summary field calculation inside the loop to aggregate Opportunity values on the parent Account prior to updating.

Cevap

The administrator should use an Assignment element inside the loop to populate a record collection variable, and then execute a single Update Records element outside the loop to commit all updates in bulk.
Bulkifying flows requires keeping data manipulation (DML) elements out of loops. Correct flow design uses an Assignment element inside the loop to accumulate modified records into a record collection variable, followed by a single Update Records element placed outside the loop path to perform the update in a single bulk operation.

Adım Adım Çözüm

1
Iterate through retrieved records
Each Opportunity record is processed individually in the loop.
Flow loops allow inspecting and modifying field values on individual items within a record collection.
2
Assign modified records to a collection variable inside the loop
Changes are stored in memory without invoking DML operations.
Using an Assignment element to add items to a record collection variable avoids performing database updates per iteration.
3
Perform a bulk update outside the loop
All record modifications in the collection are persisted in a single DML transaction.
Executing DML elements outside the loop ensures the flow stays well within Salesforce governor limits.

Anahtar Kavram

Bulkification in Flow Builder using Collection Variables and Assignment Elements
Bu soruyu puanla