Execute Anonymous Apex Console
Interactive Monaco-powered Apex scripting console with integrated debug log analysis, preset code templates, execution history, and automatic trace flag management.
⚡ 1. Overview & Architecture
Interactive Monaco-powered Apex scripting console with integrated debug log analysis, preset code templates, execution history, and automatic trace flag management.
🧭 2. Step-by-Step Workflow
Follow these steps to get maximum velocity with Execute Anonymous:
Write or Select Code
Type Apex code into the Monaco editor or select a template from the Snippets... dropdown.
Execute Script
Click ⚡ Execute or press Ctrl+Enter to execute via the Salesforce Tooling API.
Review Diagnostics
View execution outcome, duration, and inspect logs in the bottom Log Explorer panel or click Copy Log.
🛠️ 3. Key Capabilities & Superpowers
Monaco Apex Code Editor
Full IDE coding experience with Apex syntax highlighting, auto-indentation, bracket matching, and error marker diagnostics.
Pre-built Snippet Library
1-click insertion of commonly used diagnostic snippets (Query & Debug, Insert Test Record, Query User & Org, Check Limits).
Execution History
Automatically remembers your last 20 executed scripts so you can quickly retrieve, review, and re-run past scripts.
Debug Level Management
Select your target debug level (e.g., SFDC_DevConsole) with automatic trace flag creation and extension.
Integrated Diagnostics & Log Suite
Inspect compile errors, runtime exceptions, or raw debug logs directly beneath the editor with Call Tree, Timeline, and SOQL tools.
User Debug Only Filter
Instantly toggle the execution output to isolate only System.debug() statements from noisy system logs.
💡 4. Pro Tips & Keyboard Shortcuts
- Click Open in Studio Log Explorer to transfer the execution log into the dedicated full-screen Log Explorer tab.
- Use the User Debug Only toggle to instantly hide system events and focus purely on your debug statements.
Explore More SF Lens Pro Guides
Discover how other integrated studio tools can accelerate your Salesforce development and administrative workflows.