nerdexam
Salesforce

PDII · Question #404

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…

The correct answer is C. Add system.debug() statements to the code and use the Developer Console logs to trace the. See the full explanation below for the reasoning.

Question

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?

Options

  • ASet up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
  • BTurn off all Workflow Rules, then turn them on one at time to see which one causes the error.
  • CAdd system.debug() statements to the code and use the Developer Console logs to trace the
  • DRun the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code

How the community answered

(52 responses)
  • A
    13% (7)
  • B
    8% (4)
  • C
    75% (39)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full PDII Practice