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
Chris Orme 5Chris Orme 5 

How to Delete old Queued Apex Jobs?

Hello,

I opened a case with SFDC support and was redirected here. My original case comments are below. 

Hello,

In our Job Queue, there are ~25 jobs from as far back as February 2013 that are in a Status of Queued. I can't delete them in the UI, and when I tried running this query in the dev console: system.abortJob(JobId) for the specific job, I ran in to this error:

Line: 1, Column: 1
System.StringException: You can't abort scheduled Apex jobs by calling System.abortJob with an AsyncApexJob ID. Call System.abortJob with the parent CronTrigger ID.

How do I delete these old Queued Jobs?
DavidSCDavidSC
Hi Chris,
Hope this helps: http://salesforce.stackexchange.com/questions/104047/cannot-delete-asyncapexjob-using-system-abortjob
Three options are available, it seems option #2 didn't work for you.
Regards,
David