Soru

Zorluk: KolayFlow Builder Elements and Logic

An administrator needs to build an autolaunched flow to update the resolution status of multiple high-priority Support Cases associated with an Account. Which two design configurations should the administrator implement to efficiently handle this logic while adhering to Salesforce governor limits?

  1. Execute a single Get Records element before the Loop to retrieve all matching Support Cases in a single query.Cevap
  2. Add updated Case records to a Record Collection variable inside the Loop and execute a single Update Records element after the Loop.Cevap
  3. C
    Place an Update Records element directly inside the Loop element to commit changes immediately for each individual Case record.
  4. D
    Configure a Roll-up Summary element inside the Loop to calculate total open cases across lookup-related objects.

Cevap

The administrator should execute a single Get Records element before entering the Loop, collect modified records into a Record Collection variable during iteration, and execute a single Update Records element after exiting the Loop.
Bulkifying flows requires keeping database operations (Get Records, Create Records, Update Records, Delete Records) outside of Loop elements. Fetching records prior to the loop and updating a collection after the loop completes guarantees the transaction stays well within governor limits.

Adım Adım Çözüm

1
Query records outside the loop
All required Case records are retrieved into a collection variable using a single SOQL query prior to loop iteration.
Prevents exceeding the total number of SOQL queries allowed per transaction.
2
Iterate and modify records in memory
The Loop processes each Case, updates field values, and appends the modified record to a new Record Collection variable via an Assignment element.
Stores modified records in memory without making database DML calls within the loop.
3
Commit changes in a single DML operation
A single Update Records element references the collection variable after the loop terminates.
Consolidates all database write operations into one DML statement to maintain bulkification.

Anahtar Kavram

Flow Bulkification and Loop Design Patterns
Bu soruyu puanla