Execute Anonymous View
The Force.com IDE Execute Anonymous view allows you to execute an anonymous block of Apex.
Anonymous blocks help you to quickly evaluate Apex on the fly, or to write scripts that change dynamically at runtime. For example, you might write a client Web application that takes input from a user, such as a name and address, and then use an anonymous block to insert a contact with that name and address into the database.
The content of an anonymous block can include user-defined methods and exceptions. It cannot include the keyword static.
You do not need to manually commit database changes made by an anonymous block. If your Apex script completes successfully, any database changes are automatically committed. If your Apex script does not complete successfully, any changes made to the database are rolled back.
- Status information for the compile and execute phases of the call, including any errors that occur.
- The debug log content, including the output of any calls to the System.debug() method.
- The Apex stack trace of any uncaught script execution exceptions, including the class, method, and line number for each call stack element.