function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MunmunMunmun 

REGARDING SCHEDULER

Hi ,

 

Is it possible to  use batch  job with scheduler .If its possible can some one send me one example.

 

 

Ankit AroraAnkit Arora

Suppose you have a batch class with name BatchTest.. Now you want to use that in schedule class then here is the code :

 

global class scheduledBatchable implements Schedulable{
   global void execute(SchedulableContext sc) {
      BatchTest b = new BatchTest(); 
      database.executebatch(b);
   }
}

 

Also to get complete detail, please visit :

 

Batch Apex : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm

Schedule Class : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page