CRT-450 · Question #10
Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy…
The correct answer is C. Move the DML that saves opportunities outside the for loop. D. Query for existing opportunities outside the for loop. See the full explanation below for the reasoning.
Question
Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy this requirement. Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, It fails with system. Exception errors. Which two actions should the developer take to fix the code segment shown above? Choose 2 answers
Exhibit
Options
- ACheck if all the required fields for Opportunity are being added on creation.
- BUse Database.query to query the opportunities.
- CMove the DML that saves opportunities outside the for loop.
- DQuery for existing opportunities outside the for loop.
How the community answered
(55 responses)- A5% (3)
- B11% (6)
- C84% (46)
Community Discussion
No community discussion yet for this question.
