Plat-Dev-201 practice question 5 of 30
A developer is alerted to an issue with a custom Apex trigger that is causing records to be duplicated. What is the most appropriate debugging approach to troubleshoot the issue?
Full set: 204 questionsThe most appropriate and powerful approach for troubleshooting complex logic issues like record duplication in a trigger is using the Apex Interactive Debugger. This tool allows a developer to set breakpoints and step through the code line-by-line in a sandbox. It provides real-time visibility into variable states, the call stack, and heap size, enabling direct identification of the faulty logic causing the duplication, such as incorrect map usage or recursive execution, which can be difficult to trace with static logs alone.
Review the Historical Event logs to identify the source of the issue.: Event Monitoring and Setup Audit Trail logs are for tracking user actions and metadata changes, not for debugging Apex code logic execution. Add system.debug statements to the code to track the execution flow and identify the issue.: While useful, this is a less direct method. It requires modifying code and analyzing text logs, which is less efficient than real-time debugging for complex logic flaws. Disable the trigger in production and test to see if the issue still occurs.: This only confirms the trigger is the source of the problem but does not help in debugging the actual code to find the root cause of the issue.
Salesforce Apex Developer Guide, "Apex Interactive Debugger", Section: "Debug Your Code with the Apex Interactive Debugger". (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apexdebugginginteractivedebugger.htm)
Salesforce Platform Developer I Certification Guide, "Debugging and Deployment", Objective: "Describe the tools available for debugging and deploying Apex." The guide highlights the capabilities of the Apex Interactive Debugger for in-depth code analysis.
Keep practicing
Take the free Plat-Dev-201 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Plat-Dev-201 practice questions
- Question 1Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightn…
- Question 2Which two statements are true about using the @testSetup annotation in an Apex test class…
- Question 3Managers at Universal Containers want to ensure that only decommissioned containers are a…
- Question 4Universal Containers has a Visualforce page that displays a table of every Container__c b…
- Question 6Which two operations affect the number of times a trigger can fire? Choose 2 answers
- Question 7A team of developers is working on a source-driven project that allows them to work indep…
