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
Aron Schor [Dev]Aron Schor [Dev] 

Help scheduling an Apex class

Hi, there is a Apex class tied to a managed package.  It is failing as it is currently running with an inactive user.
We get emails like "Failed to process batch for class 'stayclassy.ClassyAggregateBatch' for job id 'XX'"
If I go to Apex Classes -> Schedule Apex, I do not see it.  I see the similar named "ClassyAggregate"

Any reason why I can't schedule ClassyAggregateBatch?  Thanks.  I am not a developer.
AnkaiahAnkaiah (Salesforce Developers) 
Hi Aron,

Please check the "ClassyAggregate"  class has batchable interfaces. If the ClassyAggregate has below methods, we can able to schedule it.
public class ClassyAggregate implements Database.Batchable<sObject>{


   public Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator(query);
   }

   public void execute(Database.BatchableContext BC, List<sObject> scope){
 
    }

   public void finish(Database.BatchableContext BC){
   }
}

If this helps, please mark it as best answer.

Thanks,
Ankaiah
Suraj Tripathi 47Suraj Tripathi 47
Hi Aron,

you can easily schedule an Apex Class by calling it into schedule class with proper chrone expressions
here is the below example which will help you

https://www.appseconnect.com/apex-scheduler-in-salesforce/


If you find your Solution then mark this as the best answer.


Thank you!

Regards,
Suraj Tripathi