Soru

Zorluk: KolayFlow Builder Elements and Logic

A Salesforce Administrator is building an autolaunched flow to process a list of Renewal Contracts. To ensure the flow executes efficiently without hitting SOQL or DML governor limits, which TWO design actions should the administrator take?

  1. Execute a Get Records element prior to entering the Loop element to fetch the required dataset into a record collection variable.Cevap
  2. Use an Assignment element inside the Loop to add updated record variables to a record collection, then execute an Update Records element after the Loop finishes.Cevap
  3. C
    Place a Get Records element inside the Loop to fetch related account details for each contract record during iteration.
  4. D
    Add an Update Records element inside the Loop so that field updates on each contract are committed to the database immediately upon each iteration.

Cevap

The administrator should execute a Get Records element prior to entering the Loop to fetch records into a collection variable, and use an Assignment element inside the Loop to stage record changes into a collection before performing a single Update Records operation after the Loop finishes.
Bulkification requires moving data access and manipulation elements outside of iteration loops. Fetching records prior to entering the loop gathers the dataset in a single query. Staging updates into a collection variable via an Assignment element and running a single Update Records element after the loop completes ensures all database operations occur in bulk.

Adım Adım Çözüm

1
Analyze database query strategy before entering a loop.
Identify that retrieving records before looping avoids issuing SOQL queries on every iteration.
SOQL queries inside loops consume governor limits rapidly.
2
Analyze record update strategy during iteration.
Determine that field changes should be assigned to an output collection variable inside the loop and committed via a single Update Records element after the loop completes.
DML operations inside loops violate the 150 DML statement governor limit per transaction.

Anahtar Kavram

Flow Bulkification Best Practices
Bu soruyu puanla