Haven't used the Developer Console yet? What are you waiting for?
What is the Developer Console?
The Developer Console is an integrated development environment with a collection of tools you can use to create, debug, and test applications in your Salesforce organization.
The Developer Console can help with many of your development tasks:
Debugging and Troubleshooting
The Developer Console provides a convenient set of tools for efficiently tracking down logical issues.
- View Logs: Use the Logs tab to view a list of logs. Open logs in the Log Inspector. Log Inspector is a context-sensitive execution viewer that shows the source of an operation, what triggered the operation, and what occurred afterward. Use this tool to inspect debug logs that include database events, Apex processing, workflow, and validation logic.
- Set and View Checkpoints in Apex Code: Use the Developer Console to set checkpoints to identify the source of errors. For example, if you want to understand why a certain request generates an error, you can review the execution, identify the offending logic, and set a checkpoint. When you execute the process again, you can inspect the request at that specific point to understand in detail how to improve your code. While the Developer Console can't pause execution like a traditional debugger, it provides cloud developers much of the same visibility, and reduces the need to instrument code with System.debug commands.
The Developer Console allows you to browse, open, edit and create source code files.
- Browse Packages in Your Organization: Navigate the contents of packages created in your organization.
- View and Edit Apex Classes and Triggers: Open and edit Apex triggers and classes, and open a read-only view of your custom object definitions.
- View and Edit Visualforce Pages and Components: Open and edit Visualforce pages and components.
- Use the Source Code Editor: Open a working set of code files and switch between them with a single click. The Developer Console Source Code Editor includes an auto-complete feature for Apex code.
Testing and Validating Performance
The Developer Console has a number of features dedicated to testing code and analyzing performance.
- Test Apex Code: Use the Developer Console to check code coverage and run Apex tests, including unit tests, functional tests, regression tests, and so on. To facilitate the development of robust, error-free code, Apex supports the creation and execution of unit tests. Unit tests are class methods that verify whether a particular piece of code is working properly. Unit test methods take no arguments, commit no data to the database, send no emails, and are flagged with the testMethod keyword or the isTest annotation in the method definition. Also, test methods must be defined in test classes, that is, classes annotated with isTest.
- Inspect Logs for Performance Issues: Log Inspector is a context-sensitive execution viewer that shows the source of an operation, what triggered the operation, and what occurred afterward. Use this tool to inspect debug logs that include database events, Apex processing, workflow, and validation logic. Open a debug log and view the aggregated performance of an operation in the Performance Tree. The Executed Units panel breaks up the request both by time and type, and categorizes the timings by methods, queries, workflows, callouts, DML, validations, triggers, and pages, giving you a clear idea of where to find performance issues. Use the Timeline panel to see a timeline view of the overall request and walk through the events for a given block. The Limits panel provides a summary view of resources used and maps them against your allocated request limits.
Executing SOQL and SOSL Queries
The Developer Console provides a simple interface for managing SOQL and SOSL queries.
Edit and Execute SOQL and SOSL Queries: Use the Query Editor to query data from your organization.
- View Query Results: Results are displayed in a Query Results grid that allows you to open, create, update, and delete records. In SOSL search results with multiple objects, each object is displayed on a separate tab.
Where is the Developer Console?
To open the Developer Console, click Your Name | Developer Console or navigate to Setup | Develop | Tools and click the Developer Console link.
The Developer Console opens in a separate window. The UI is organized into the following sections:
- A menubar.
- A workspace with a tab for each open item.
- A panel with Logs, Problems, and Progress tabs for viewing real-time execution data.
For details, see the Developer Console User Interface Overview.