Salesforce Platform Developer I (legacy) — Question 186
Which two practices should be used for processing records in a trigger? (Choose two.)
Answer options
- A. Use a Map to reduce the number of SOQL calls.
- B. Use @future methods to handle DML operations.
- C. Use a Set to ensure unique values in a query filter.
- D. Use (callout=true) to update an external system.
Correct answer: A, C
Explanation
Using a Map helps optimize SOQL calls by reducing the number of queries needed, which is crucial in trigger contexts. A Set ensures that only unique values are considered in a query filter, preventing duplicates and improving efficiency. The other options, while useful in certain scenarios, do not directly address the primary practices for processing records in triggers.