I am trying to run my Batch Class called UltimateParentAccount for every 6am and 12pm using a Cron Job Schedulable name ScheduleUltimeParentAccountBatch.
I tested my batch class and it works well, and then I create a schedulable class which is ScheduleUltimeParentAccountBatch and called the batch class to set a Cron Job.
But I encoutered an Error:
Method does not exist or incorrect signature: void schedule(String, String, UltimateParentAccount) from the type System
Here is my code for my schedulable class:
global class ScheduleUltimeParentAccountBatch implements Schedulable{
global void execute(SchedulableContext sc){
UltimateParentAccount upc = new UltimateParentAccount();
String sch = '0 0 6,12 ? * *';
System.schedule('My Job', sch, upc);
}
}
Where did I go wrong? And I checked the some docx about the syntax of schedule method and it seems fine to me but then still I encoutered an error.