0

Can we invoke an apex class(not batch apex class) from a Schedulable Class?

5

Yes, you can call any public class you want from the schedulable context. There are no limitations that would prevent you from calling public static methods:

public void execute(SchedulableContext context)
{
    MyClass.doStuff(/*parameters*/);
}

Nor any limitations that would prevent you from calling public instance methods:

public void execute(SchedulableContext context)
{
    new MyClass(/*parameters*/).doStuff(/*parameters*/);
}
  • It was quick. Thank you for your valuable input. :) – SFDC Mafia - VIC Jun 15 '17 at 18:21

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.