exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 39 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 39
Topic #: 1
[All Certified Platform Developer II Questions]

An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What is the optimal method for a developer to troubleshoot this?

  • A. Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
  • B. Turn off all Workflow Rules, then turn them on one at time to see which one causes the error.
  • C. Add system.debug() statements to the code and use the Developer Console logs to trace the code.
  • D. Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
BrainMelt12
1 month, 1 week ago
Selected Answer: C
I choose C, because the debug logs can catch the below issues: Trigger recursion: If an Order__c record creation causes another update on Opportunity, which re-fires the trigger, causing another Order__c record. Automation Conflicts: The trigger might be running twice due to a combination of Workflow Rules, Process Builder, or other automation. Duplicate Trigger Logic: The trigger might lack a check to prevent multiple insertions. It's not A, due to this being inefficient because not all Sales Reps will trigger the issue every time. You'll be digging through logs for hours. Since the records insert correctly, there may not be any errors.
upvoted 1 times
...
corpex
7 months, 2 weeks ago
Selected Answer: C
Answer is C. You probably won't receive any error or exception since the two workorders are inserted correctly. Probably a recursion error made by the opportunity update. It's best to add system.debug and check what is going on...
upvoted 4 times
...
KyrgyzBoy
1 year, 5 months ago
Selected Answer: A
APEX CLASS UPDATE NOT PERMITTED IN PROD
upvoted 2 times
Dylluan
12 months ago
Question doesn't say anything about PROD though
upvoted 6 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago