How to Stop Apex Scheduled jobs in Salesforce

System.abortJob(Id) can do this. Simply pass in the Id of the AsyncApexJob for the job in question.

You’ll note the docs specifically mention System.schedule results can be passed in, which would represent the scheduled job id; this same value can be obtained from the AsyncApexJob table.

Its possible using the below piece of code:
Run the following piece of code in your salesforce org developer console to deactivate any active jobs
-> Go to developer console> Debug (from top menu)> Open Execute Anonymous Window.

Paste below code and hit Execute from Developer Console:

<div class="post-text">
<pre><code>for (CronTrigger ct : [SELECT Id FROM CronTrigger]) {
    System.abortJob(ct.Id);
}
</code></pre>
</div>
<div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy"><time datetime="2014-01-30T15:02:47"></time>
<div class="grid--cell mr16"></div>
</div>

 

Job Status from Apex Job Queue Object:

STATUS DESCRIPTION
Queued Job is awaiting execution.
Preparing The start method of the job has been invoked. This status might last a few minutes depending on the size of the batch of records.
Processing Job is being processed.
Aborted Job was aborted by a user.
Completed Job completed with or without failures.
Failed Job experienced a system failure.

Monitoring the Apex Job Queue – https://dreamevent.secure.force.com/articleView?id=code_apex_job.htm&type=0

Written by 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

Your email address will not be published. Required fields are marked *

*