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
Yishay Haspel 10Yishay Haspel 10 

Cannot schedule a Schedulable apex class


We've got a class implementing Schedulable, Database.Batchable<sObject>, Database.stateful.
The class has the needed global void execute(SchedulableContext SC), but when trying to schedule it I get:
Error: You must select an Apex class that implements the Schedulable interface
What are we missing?

Many thanks,
Hi Yishay,

Try something like this:
global static void schedule() {
        CurrentClass sch = new CurrentClass();
        System.schedule('Your Title for the Scheduled Job', '0 0 0 * * ?', sch);
 global void execute(SchedulableContext sc) {
        // call class to be scheduled, e.g. database.executebatch(new ClassToBeScheduled());

Hope it helps,
Vijay NagarathinamVijay Nagarathinam
Hi Yishay Haspel,

If your schedule class is missing in UI it happend because of apex class version problem, you can schedule the class by using the developer console. Refer the below code.
autoCreateIS schedule =new autoCreateIS();
String sch ='0 0 0 1 1 ?';
System.schedule('YOurchoiceofname Scheduled',sch, schedule);
Please let me know if you need any help regarding this.

Yishay Haspel 10Yishay Haspel 10
Hi Sabina/Vijay,

Thank you for the replay.
I used your ideas, and we will schedule it in the install script.

Have a nice day,