+ 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