Loading
Salesforce now sends email only from verified domains. Read More

Execute a Batch Apex from the Developer Console

Publish Date: Jun 14, 2024
Description

Execute batch Apex from the Developer console to create complex automated processing.

Resolution

Run Batch Apex

  1. Open the Developer Console
  2. Click Debug | Open Execute Anonymous Window
  3. Execute the following code
Id <variable name>= Database.executeBatch(new <Class name>(), batch size);

Example code:

Id batchJobId = Database.executeBatch(new RunThisBatch(), 200);


Note: The Apex class should implement interface Database.Batchable. The variable batchJobId will contain the job Id of the batch.

To monitor or stop the execution of the batch Apex job: from Setup, enter Apex Jobs in the Quick Find box, then select Apex Jobs.

Knowledge Article Number

000385654

 
Loading
Salesforce Help | Article