This post is in continuation of my previous post where I have explained the basic configuration of Apex Debugger. If you haven’t gone through that, I would request you to please go here.
So with the assumption that you have configured Apex Debugger correctly and can do debugging, in this post, I will explain some advanced configurations which you can do with Apex Debugger.
So let’s start –
- Choose for which user you want to enable the Apex Debugger – You can choose the user for which you want to enable the Apex Debugger. For that open Debug Configuration. Then check the Whitelisting Enabled and Use SOQL where clause option. Then put the where clause. For example in the below screenshot, I have put the ID of the user and clicked on the Query button
- Choose the request type – With this option you can select the request type for which you want to enable the Apex Debugger. Currently we can enable Apex Debugger for the below options – Execute Anonymous, Inbound Email Service, Invocable Action, Lightning/Aura, Quick Action, REST, Run Tests Synchronous, SOAP, Synchronous, Visualforce, Visualforce Remote Method. If you don’t choose anything, it means it is enabled for all the above types of requests.
- Choose Entry Point – With this option, you can choose the entry point. For example if you want to enable Apex Debugger for particular Visualforce page, you can put .*/apex/DemoPage
.apexp
Implementation:
1 | <apex:page standardController="Contact" extensions="SudiptaDeb_ContactList_Demo" showheader="false"> |
1 | public with sharing class SudiptaDeb_ContactList_Demo { |
Debugging:
- I will give my User ID in the Debug Configuration | Whitelisting Enabled section to make sure only my requests will be considered for Apex Debugging. With this option, if someone else is working in the same Sandbox, their requests will not be tracked here.
- I will select VisualForce under request type because I am only interested to debug when the execution will trigger from VisualForce page. My intention is that I will do some activity in the VisualForce page and I would like to debug the Apex controller code.
Here is the screenshot of all the configurations –
Now in the controller, I will put breakpoints @ line # 4, 7 and 13. After that with Debugger session on, when I will select an account in the VF page, the execution will stop at the breakpoints. Below is the screenshot –
Apex Debugger Considerations –
Click here
Please let me know your feedback. Thanks in advance. Happy Salesforce Debugging!!!