Skip to main content Join the Agentforce Virtual Hackathon to build innovative solutions and compete for a $50k Grand Prize. Sign up now. Terms apply.
You have exceeded the maximum number (100) of Apex scheduled jobs.

Hi, Is there any workaround to overcome the above governor limit?
1 resposta
  1. 7 de out. de 2019, 12:44
    Hi Bhagyashree,

    You can create schedulable class (not a batch, not a future) and that class would invoke two batch jobs one after the other one. This would mean you are scheduling only one class, but you are able to run two batch jobs at the same time.

    Note:- The batch jobs would run one after another. The second batch job would start, once the first one is finished.

    A sample Apex snippet is below:-

    //declaration of scheduler class

    global class ScheduleMultipleBatchJobs implements schedulable

        {

        //method to implement Apex schedulers

        global void execute(SchedulableContext ct)

            {

                BatchDeletion BD = new BatchDeletion();

                Database.executebatch(BD);

                UpdateAccountFields UP = new UpdateAccountFields();

                Database.executebatch(UP);

            }

        }In the above example we are invoking two batch jobs (BatchDeletion & UpdateAccountFields) with one schedulable class (ScheduleMultipleBatchJobs).

    Thank You,

    www.nubeselite.com

    Development | Training | Consulting

    Please mark this as solution if your problem is solved.
0/9000