Qus:    How to schedule batch apex?
Aug 28, 2021 04:27 1 Answers Views: 268 NAIDU
Prev Next
Answers (1)
RAMU Sep 01, 2021 23:28
Answer:   To schedule the batch class we should write a separate class by implementing Schedulable interface.

After writing the above mentioned classes to schedule navigate to: Develop > Apex Classes > Schedule Apex.

By clicking on Schedule Apex button we can schedule the batch class through user interface.

Note: Through user interface we cannot schedule in hours/minutes.

Schedulable Class Syntax:

global class SchedulableUsage implements Schedulable {

global void execute(SchedulableContext sc) {

BatchUsage bu = new BatchUsage();

//Database.executeBatch(bu);//Default Batch Size is: 200.

Database.executeBatch(bu,1500);//Max. Batch Size is: 2000.

}

}

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect