-
Notifications
You must be signed in to change notification settings - Fork 480
BatchApexRecipes
Demonstrates the use of the Database.Batchable interface. The methods in this class are called by the system as the batch executes. To enqueue this batch use Database.enqueueBatch(new BatchApexRecipes());
More on the Batchable interface: https://sfdc.co/batch_interface
This method is where the actual work occurs. It's run once per batch.
Param | Description |
---|---|
context |
dependency injected by the system in this batch. It's this |
scope |
a list of up to 200 SObject records to be processed |
Database.enqueueBatch(new BatchApexRecipes());
This method is called by the system when all the individual batches have completed. Intrepid developers may send emails, or otherwise notify others of the job's completion here.
Param | Description |
---|---|
context |
dependency injected by the system |
Database.enqueueBatch(new BatchApexRecipes());
This method is required by the Batchable interface. It's responsible for identifying the records that will be affected Your start method can either return a QueryLocator or an Iterable (List) The records identified here will be made available to the execute method below, in batches of up to 200 records at a time.
Param | Description |
---|---|
context |
dependency injected by the system |
Type
Database.QueryLocator
Description
Database.QueryLocator QueryLocator object used for context
Database.enqueueBatch(new BatchApexRecipes());