The Execute Anonymous Apex tool in the Developer Console runs the Apex code you enter using ExecuteAnonymous and generates a debug log with the results of the execution.
- Click Debug | Open Execute Anonymous Window to open the Enter Apex Code window.
- Enter the code you want to run in the Enter Apex Code window or click Triangle icon to open the code editor in a new browser window. To automatically open the resulting debug log when execution is complete, select Open Log.
- Execute the code