Loading

Execute a Batch Apex from the Developer Console

Udgivelsesdato: Jun 14, 2024
Beskrivelse

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

Løsning

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.

Yderligere ressourcer

Developer Console

Using batch Apex

Vidensartikelnummer

000385654

 
Indlæser
Salesforce Help | Article