Ora

How do I deactivate scheduled jobs in Salesforce?

Published in Salesforce Automation 3 mins read

To deactivate a scheduled job in Salesforce, you primarily delete it from the "Scheduled Jobs" page within Setup. This action immediately stops any future executions of that specific job.

Understanding Scheduled Jobs in Salesforce

Salesforce offers various ways to automate processes, many of which can be scheduled to run at specific times or intervals. These "scheduled jobs" can include:

  • Apex Scheduler Jobs: Used for running Apex classes, often to process large data sets (Batch Apex) or execute custom logic at set times.
  • Scheduled Flows: Automate business processes through flows that run daily, weekly, or at a custom frequency.
  • Scheduled Data Export: Automatically export Salesforce data to a CSV file.
  • Scheduled Reports and Dashboards: Deliver critical business insights to users on a recurring basis.

Deactivating a scheduled job is crucial when it's no longer needed, requires modification, or is causing unintended issues.

Step-by-Step Guide to Deactivating Scheduled Apex Jobs

The most common method for deactivating scheduled jobs, particularly those involving Apex, is through the Scheduled Jobs page.

  1. Navigate to Setup:
    • Click the gear icon (⚙️) in the top-right corner of Salesforce, then select Setup.
  2. Access Scheduled Jobs:
    • In the Quick Find box on the left sidebar, type "Scheduled".
    • From the search results, click on Scheduled Jobs under the 'Jobs' section.
  3. Identify the Job:
    • On the "Scheduled Jobs" page, you will see a list of all currently scheduled Apex jobs. Each entry includes details such as the Job Name, Scheduled Type, Submitted By, and Next Run time.
    • Locate the specific job you wish to deactivate. Pay attention to the Job Name (often derived from the Apex class or a descriptive label) to ensure you're deleting the correct one.
  4. Delete (Deactivate) the Job:
    • Next to the job you want to deactivate, click the Del (Delete) link.
  5. Confirm Deletion:
    • A confirmation prompt will appear. Click OK to confirm that you want to delete the scheduled job.

Once confirmed, the job will be immediately removed from the list and will no longer execute at its previously scheduled times. If you need to run it again, you will have to reschedule it.

Important Considerations for Different Job Types

While the "Scheduled Jobs" page is central for Apex-based jobs, other scheduled processes are managed elsewhere:

Job Type Management Location Notes
Apex Scheduler Jobs (e.g., Batch Apex) Setup > Scheduled Jobs Deactivated by "Del" link.
Scheduled Flows Setup > Flows > (Specific Flow) > Run button Click "Run" (Scheduled Paths) to view/manage schedule, then "Delete Scheduled Run."
Scheduled Data Export Setup > Data > Data Export Deselect "Schedule Export" and save the settings.
Scheduled Reports/Dashboards Reports Tab / Dashboards Tab > Specific Report/Dashboard > Subscribe Edit or delete the subscription to stop scheduled deliveries.

Best Practices Before Deactivating

  • Understand Dependencies: Before deleting a scheduled job, ensure that no critical business processes rely on its execution. Unexpectedly stopping a job could disrupt data synchronization, reporting, or other automated tasks.
  • Inform Stakeholders: Communicate with relevant users or departments about the deactivation, especially if the job provides them with data or initiates processes they depend on.
  • Document Changes: Keep a record of when and why a job was deactivated. This can be valuable for auditing and future troubleshooting.
  • Monitor Running Jobs: If you suspect a job might be currently running, you can monitor its status via Setup > Apex Jobs (for Apex jobs) or Setup > Background Jobs for other processes. Deleting a scheduled job will prevent future runs, but won't immediately stop an instance that is already executing.

By following these steps, you can effectively deactivate scheduled jobs in Salesforce, maintaining control over your automated processes and ensuring system performance.