Using the Salesforce.com Developer Console for real-time debugging
The Salesforce.com System Log (now the Developer Console) is a valueable tool for any administrator or developer. It can be used to watch requests come into Salesforce.com in real-time. The Salesforce.com Developer Console also allows you to execute anonymous Apex code in real-time. This page will show you where to find the Developer Console and guide you through how to use it.
Before we begin, make sure you are logged into Salesforce.com either in a Developer account or as a System Administrator.
To launch the Salesforce.com Developer Console follow these instructions:
Step 1- After logging into Salesforce.com, click on the Developer Console under your name. See below:
After clicking on the Developer Console link, the Salesforce.com Developer Console will open in a new window. If you've got two monitors, drag the Developer Console window over to one and have Salesforce.com open in the other. I do this because I like to see them both at the same time. With the Developer Console up, any request that comes into Salesforce.com will show up in your Developer Console window in real-time. You can see in the screenshot below that a single request has come in:
Step 2 - View the details of requests as they show up in the Salesforce.com Developer Console window. You can view the details of a given request by clicking on the row of the request you would like to view. When you click on the row, all the details that Salesforce.com has captured will show up in the box below. In the screenshot below, you can see that a given request has been clicked on (highlighted in grey) and all its details are shown:
Step 3 - You can use the Salesforce.com Developer Console to execute Apex code on the fly. This is considered "anonymous" execution. In the screenshot below, we've inserted a single statement into the code window.
When we click the "Execute" button in the Salesforce.com Developer Console (shown above) we can see that it executes the line of code we've entered and displays the log results in the box below.