December 2013
Intermediate to advanced
448 pages
13h 44m
English
Batch Apex can be executed from a Visualforce page, scheduled to run automatically at specific times, or kicked off from within a trigger. But the easiest way to experiment with it is in the Execute Anonymous view in the Force.com IDE.
First, enable debug logging for your user in the Administration Setup area; select Monitoring, Debug Logs; and add your user to the list of monitored users by clicking the New button. This is no different than debugging any Apex class. Using the Execute Anonymous view, enter the code in Listing 9.2 and execute it. The batch is submitted and its unique job identifier displayed in the results box.
Listing 9.2 Running Sample Batch Apex Code
Listing9_1 batch ...