How to run batch Class in Salesforce?

1. From the Developer Console, click Debug | then Open Execute Anonymous Window.
2. Execute the following code.

Id runningJobID = Database.executeBatch(new TestBatchForRun(), 200);

After running this piece of code you will get the Debug log for the same and you check if the batch is running or not.
With this you can even go to Setup > Apex Jobs > Check the Job type as Batch Apex and check if the job is running. once completed you will see the status as Completed and you can check output after that.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s