How to invoke batch apex job (or) how to execute the batch apex job programmatically?
We can use database.executebatch ( ) method to programmatically begin the batch job. Syntax: Public static ID execute batch ( sObject class name) Public static ID execute batch (sObject class name, integers scope) The above two methods are static methods of database class. We can use any one of the methods to execute the batch job. Note: The class name that we are passing to the database.execute batch( ) method should be the object of the class which has implemented the database.batchable interface.