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
Bhagyashree SuryavanshiBhagyashree Suryavanshi 

How to schedule more than 100 jobs?

You have exceeded the maximum number (100) of Apex scheduled jobs.
Hi, Is there any workaround to overcome the above governor limit?
Nubes Elite Technologies Pvt. LtdNubes Elite Technologies Pvt. Ltd
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.