ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 259 - Certified Platform Developer II discussion

Report
Export

The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer.

The test method fails at the Line 20 because of too many SOQL queries

What is the correct way to fix this?

The test method above tests an 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?

A.
Add TesLstartTest() before and Test.stop Test() after both Line 7 of the code and Line 20 of the code.
Answers
A.
Add TesLstartTest() before and Test.stop Test() after both Line 7 of the code and Line 20 of the code.
B.
Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced.
Answers
B.
Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced.
C.
Add TeststartTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code.
Answers
C.
Add TeststartTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code.
D.
Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger.
Answers
D.
Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger.
Suggested answer: C
asked 23/09/2024
Jucelino Pinheiro de Andrade da Silva
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first