Ad
Ad
Ad
Beginner Dev

Dev Tip 3: Execute Batch job from Anonymous Window/Dev Console

Pinterest LinkedIn Tumblr

 Dev Tip 3: Execute Batchjob from Anonymous Window/Dev Console

In this post, we will try to understand how to execute a Batch job from Dev Console. We could use the below command in the Execute Anonymous tab of Dev Console.

You could use any of the below Commands

Database.executebatch(new BatchjobName);

Database.executebatch(new BatchjobName,Size);

Example: We have a batch job AccountProcessBatch that needs to be executed with a default size.

Database.executebatch(new AccountprocessBatch());

Note: Default size for Batch job is 200.

Example: If we want our batch job (AccountProcessBatch)  to be executed with the desired size such as 500 then we will use the below command.

Database.executebatch(new AccountprocessBatch(),500);

Write A Comment