Reader small image

You're reading from  Mastering Apex Programming

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781800200920
Edition1st Edition
Languages
Right arrow
Author (1)
Paul Battisson
Paul Battisson
author image
Paul Battisson

Paul Battisson is the CEO of Groundwork Apps, a Salesforce ISV Partner, a 9- time Salesforce MVP, and a current MVP Hall of Fame member. He has spoken at numerous Salesforce events including Dreamforce, London's Calling, the Salesforce London World Tour, India Dreamin, and DreamOle. He runs the Leeds Developer Group in the UK and the CloudBites TV website and YouTube channel where he helps Salesforce developers, consultants, admins and architects. He is the author of multiple books and training courses on Salesforce programming.
Read more about Paul Battisson

Right arrow

Invoking Batch Apex

There are a number of different ways in which we can invoke a Batch Apex class to run, which will be useful in different circumstances and use cases. In this section, we will review the different ways in which you can invoke Batch Apex and when each of them might be applicable. We will also discuss some ways in which you can utilize a number of Salesforce features together to allow you to invoke Batch Apex in a more dynamic and configuration controlled fashion. Let's begin with the first one.

Using Database.executeBatch

The first way to invoke Batch Apex is through the use of the standard Database.executeBatch() method. This method takes in an instance of a class implementing the Database.Batchable interface and a second optional parameter to define the size of the scope of each batch. As mentioned in the The base interface section, for implementations using QueryLocator instances, this defaults to 200 records and has a maximum value of 2,000 records...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Apex Programming
Published in: Nov 2020Publisher: PacktISBN-13: 9781800200920

Author (1)

author image
Paul Battisson

Paul Battisson is the CEO of Groundwork Apps, a Salesforce ISV Partner, a 9- time Salesforce MVP, and a current MVP Hall of Fame member. He has spoken at numerous Salesforce events including Dreamforce, London's Calling, the Salesforce London World Tour, India Dreamin, and DreamOle. He runs the Leeds Developer Group in the UK and the CloudBites TV website and YouTube channel where he helps Salesforce developers, consultants, admins and architects. He is the author of multiple books and training courses on Salesforce programming.
Read more about Paul Battisson