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.
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...
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.
corpex
8 months, 2 weeks agoKyrgyzBoy
1 year, 6 months agoDylluan
1 year ago