function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SF_ChimpSF_Chimp 

What are the best ways to debug apex and visualforce pages?

Ken KoellnerKen Koellner
Set Monitoring->Debug and specifiy your user in Setup so you can look at your Apex logs for your controller and subbordinate classes.  Add Debug prints to your classes as needed.

If you have client-side Javascript in your pages, use a tool like Firebug in Firefox when you have to debug your javascript.

Use Developers Console from Setup.  It's a tad flaky but on a good day you can look at your Apex logs and also set dump points where you can get a dump of the variables at certain execution points.  Also, if you need need to run a few lines of ad-hoc code to better understand how something works, you can run anonymous apex.

From your User record, turn on Development Mode and also the View State option below it.  Then when you are looking at your page, in the lower pain you can inspect some of your controller data.