• yaramareddy radhika
  • NEWBIE
  • 25 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 7
    Replies
This is the batch Apex class which i am reffering in schedule apex class
==========================================================
global class BatchApexUpdate implements Database.Batchable<Sobject>{
    global string qe=[select Id,description from Account];
    
    global Database.QueryLocator start(Database.BatchableContext bc){
        return Database.getQueryLocator(qe);
    }
    global void execute(database.BatchableContext bc,List<Account> scope){
        for(Account a:scope){
          a.Description='Batch Test';
            a.Industry='sunderinfotech';
        }
        update scope;
    }
    global void finish(Database.BatchableContext bc){      
    
        OutboundEmail1 ob= new OutboundEmail1();
        ob.send();
    
    }
}


Schedule Apex class
====================

public class ScheduleExamp2 implements Schedulable{
    public void execute(SchedulableContext sc){
       
      BatchApexUpdate ba= new BatchApexUpdate();
}
}

Execution code in anonymous window   
===============================
ScheduleExamp2 se=new ScheduleExamp2();
string cron='0 0 16 2 1 2 2017';
ID jobid=system.schedule('batchapex', cron,se );

while executing this i am getting above error.
 
This is the batch Apex class which i am reffering in schedule apex class
==========================================================
global class BatchApexUpdate implements Database.Batchable<Sobject>{
    global string qe=[select Id,description from Account];
    
    global Database.QueryLocator start(Database.BatchableContext bc){
        return Database.getQueryLocator(qe);
    }
    global void execute(database.BatchableContext bc,List<Account> scope){
        for(Account a:scope){
          a.Description='Batch Test';
            a.Industry='sunderinfotech';
        }
        update scope;
    }
    global void finish(Database.BatchableContext bc){      
    
        OutboundEmail1 ob= new OutboundEmail1();
        ob.send();
    
    }
}


Schedule Apex class
====================

public class ScheduleExamp2 implements Schedulable{
    public void execute(SchedulableContext sc){
       
      BatchApexUpdate ba= new BatchApexUpdate();
}
}

Execution code in anonymous window   
===============================
ScheduleExamp2 se=new ScheduleExamp2();
string cron='0 0 16 2 1 2 2017';
ID jobid=system.schedule('batchapex', cron,se );

while executing this i am getting above error.