Things to Remember while working with Apex Scheduler:

  1. The System.Schedule method uses the user’s timezone for the basis of all schedules, but runs in system mode (i.e. all classes are executed, irrespective of the user’s permissions).
  2. While scheduling a class from a trigger, the trigger should not add more scheduled job classes than the limit.
  3. We can have 100 scheduled Apex jobs at one time.
  4. The maximum number of scheduled Apex executions per a 24-hour period is 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater.
  5. Synchronous Web service callouts are not supported from scheduled Apex. To be able to make callouts, make an asynchronous callout by placing the callout in a method annotated with @future(callout=true) and call this method from scheduled Apex. However, if scheduled Apex executes a batch job, callouts are supported from the batch class.
  6. Salesforce schedules the class for execution at the specified time. Actual execution may be delayed based on service availability.
  7. If there are one or more active scheduled jobs for an Apex class, we cannot update the class or any classes referenced by this class through the Salesforce user interface. However, we can enable deployments to update the class with active scheduled jobs by using the Metadata API (for example, when using the Salesforce extensions for Visual Studio Code).
  8. We can programmatically query the CronTrigger and CronJobDetail objects to get the count of Apex scheduled jobs.
  9. Though it’s possible to do additional processing in the execute method, but for best practices all processing should take place in a separate class.
Like it ? Share : Do Nothing

Leave a Reply