Benefits of batch apex The execution logic of the batch class is called once for each batch of records. The default batch size is 200 records. You can also specify a custom batch size. Furthermore, each batch execution is considered a discrete transaction. With each new batch of records, a new set of governor limits is in effect. In this way, it’s easier to ensure that your code stays within the governor execution limits. Another benefit of discrete batch transactions is to allow for partial processing of a batch of records in case one batch fails to process successfully, all other batch transactions aren’t affected and aren’t rolled back if they were processed successfully. This is a use case that we all come across very often, Schedule a batch class every hour to clean up data or to send out batch emails to case team members (Which I’ll blog about later). There are three main steps involved in this 1. Write a Batch class with the ...
Comments
Post a Comment