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
dhanyadhanya 

Scheduling Batch Apex

Hi,

 

When scheduling a batch, it seems to throw an error : 'System.UnexpectedException: Schedulable instance is too big: scheduleCampaignBatch'. Any idea why this happens?

 

scheduleCampaignBatch is the scheduler class that schedules the batch. This error is thrown when we try to call the scheduler.

 

Thanks in advance.

LVSLVS

Interesting as this is not documented anywhere.

 

However, the Apex Scheduler best practices recommends that "Though it's possible to do additional processing in the execute method, we recommend that all processing take place in a separate class"

 

Can you check if your execute() is too long? If so, try moving it into a separate class and call it from the scheduled class' execute()