You are here:
Developer Console Functionality
The Developer Console can help with many of your development tasks.
Required Editions
| Available in: Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions |
| User Permissions Needed | |
|---|---|
| To use the Developer Console: | API Enabled AND View All Data |
| To view, retain, and delete debug logs: | View All Data |
| To execute anonymous Apex: | Author Apex |
| To use code search and run SOQL or SOSL on the query tab: | API Enabled |
| To save changes to Apex classes and triggers: | Author Apex |
| To save changes to Visualforce pages and components: | Customize Application |
| To save changes to Lightning resources: | Customize Application |
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 in the Developer Console. It shows the source of an operation, what triggered the operation, and what occurred next. 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 much of the same
visibility and reduces the need to add
System.debugstatements.
Editing and Navigating Source Code
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 Lightning Components: Open and edit Lightning resources, such as an application, component, event, or interface.
- 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.
- Format Your Code Files: You can use the Prettier code formatter to format your
Aura components in Developer Console.
To prettify the code in an open file, select Edit | Fix Code Formatting. Or, press Ctrl+Alt+F. To configure your code-formatting settings, select File | Preferences and then adjust the settings whose names begin with Prettier:. For information about these settings, see Options in the Prettier documentation.
Note Fix Code Formatting isn’t available in Internet Explorer.
Testing and Validating Performance
The Developer Console has various 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, and send no emails.
Such methods are flagged with the
@isTestannotation in the method definition. Unit 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 in the Developer Console. It shows the source of an operation, what triggered the operation, and what occurred next. 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 by time and type. It 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, in which you can open, create, update, and delete records. For SOSL search results with multiple objects, each object is displayed on a separate tab.

