Salesforce
PDII · Question #206
PDII Question #206: Real Exam Question with Answer & Explanation
Sign in or unlock PDII to reveal the answer and full explanation for question #206. The question stem and answer options stay visible for context.
Question
The test method above tests in Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers. The test method fails at the Line 20 because of too many SOQL queries. What is the correct way to fix this?
Options
- AChange the DataFactory class to create fewer Accounts so that the number of queries in the
- BAdd Test.startTest() before and Test.stopTest() after both Line 7 of the code and Line 20 of the
- CAdd Test.startTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code
- DReplace most of the Apex Trigger with Process Builder processes to reduce the number of queries
Unlock PDII to see the answer
You've previewed enough free PDII questions. Unlock PDII for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.