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.
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.
What Tasks Can You Accomplish with the Developer Console?
- 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 debugcommands.
- 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. 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 testMethodkeyword 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, 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.
- Open CTRL+O
- Open Lightning Resources CTRL+SHIFT+A
- Open log CTRL+G
- Open raw log CTRL+SHIFT+G
- Download log CTRL+ALT+G
- Save the current view CTRL+S
- Save all CTRL+SHIFT+S
- Delete CTRL+DELETE
- Close CTRL+/
- Close all CTRL+ALT+/
- Open the Execute Anonymous window CTRL+E
- Execute anonymous Apex code when the Execute Anonymous window is open or the last executed code when the window is closed CTRL+ALT+E
- View log panels… CTRL+P
- Log panel SHIFT+ALT+G
- Show/Hide help for the shortcut key CTRL+SHIFT+?
- Find CTRL+F
- Find/replace CTRL+SHIFT+F
- Find/replace all CTRL+SHIFT+R
- Search in files CTRL+SHIFT+H
- Fix indentation SHIFT+TAB
- Open resource CTRL+SHIFT+O
- Clear log panel SHIFT+ALT+G
- Show Preview of the Visualforce page/component CTRL+J
- Navigate to the declaration of a selected object in the Source Code Editor CTRL+ALT+N
- Show/Hide the Command Line Console CTRL+SHIFT+L
- Navigate backward through the view history CTRL+,
- Navigate forward through the view history CTRL+.
- Navigate backward through the open views CTRL+PAGE UP
- Navigate forward through the open views CTRL+PAGE DOWN
- Toggle full screen editing of the current view, if available F11
- Exit full screen editing of the current view, if active ESC
“Explore – Techila Global Services, A Salesforce development company”