0

When i try to create a scheduler class I am getting an error

Method does not exist or incorrect signature: void schedule(String, String, UpdateCloseDateOpportunityBatchClass) from the type System

My scheduler class :

global class SchduleBatchUpdateOppCloseDate implements Schedulable{
global void execute(SchedulableContext SC) {
  //UpdateCloseDateOpportunityBatchClass p = new UpdateCloseDateOpportunityBatchClass();
  String sch = '0 0 0 1 JAN,APR,JUL,OCT ? *';
  System.schedule('Quarter Job', '0 0 0 1 JAN,APR,JUL,OCT ? *', new UpdateCloseDateOpportunityBatchClass ());
}   
}

Do any one have any idea what is wrong with the code. I am using Salesforce.com API Version is 41.0

0

You need to pass instance of scheduler class while you are passing instance of batch class. So you are getting the incorrect signature error.

global class SchduleBatchUpdateOppCloseDate implements Schedulable{
    global void execute(SchedulableContext SC) {
      UpdateCloseDateOpportunityBatchClass p = new UpdateCloseDateOpportunityBatchClass();
      Database.execute(p);
   }   
}

Then run this code

System.schedule('Quarter Job', '0 0 0 1 JAN,APR,JUL,OCT ? *', new SchduleBatchUpdateOppCloseDate());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.