Using The Developer Console To Execute Apex Code
Using The Developer Console To Execute Apex Code
Using The Developer Console To Execute Apex Code
2.
around a while ;-). But, when youre coding in the cloud, where does the
output go? Read on!
3.
Every time you execute code, a log is created and listed in the Logs panel.
Double-click a log to open it in the Log Inspector. You can open multiple logs at a
time to compare results.
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.
The Log Inspector includes predefined perspectives for specific uses.
Click Debug | Switch Perspective to select a different view, or click CTRL+P to
select individual panels. Youll probably use the Execution Log panel the most. It
displays the stream of events that occur when code executes. Even a single
statement generates a lot of events. The Log Inspector captures many event
types: method entry and exit, database and web service interactions, and
resource limits. The event type USER_DEBUG indicates the execution of
a System.debug() statement.
1.
3.
4.
In the Execution Log panel, select Executable. This limits the display to
only those items that represent executed statements. For example, it filters
out the cumulative limits.
5.
To filter the list to show only USER_DEBUG events, select Debug Only or
enter USER in the Filterfield.
Tell Me More...
Help in the Developer Console
To learn more about the Developer Console, click Help | Help Docs in
the Developer Console.
Anonymous Blocks
The Developer Console allows you to execute code statements on the fly.
You can quickly evaluate the results in the Logs panel. The code that you
execute in the Developer Console is referred to as an anonymous block.
Anonymous blocks run as the current user and can fail to compile if the
code violates the users object- and field-level permissions. Note that this
isnt the case for Apex classes and triggers.
https://developer.salesforce.com/docs/atlas.enus.apex_workbook.meta/apex_workbook/apex1_2.htm