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
Andres SchmoisAndres Schmois 

Salesforce Bug on System.schedule

I've been coding in a sandbox and figuring out how to schedule jobs through Apex and I ran into a few errors where I was receiving an error "Based on configured schedule, the given trigger will never fire". Anyways after a bit of changing code around and finding out why I was getting that, I went into my scheduled jobs and now I have a couple orphaned AsyncApexJobs that I cannot delete because they do not belong to a parent cron trigger. I've seen a few of these errors on the forums and all answers say that Salesforce backend team had to delete the jobs themselves.

If you want to reproduce this error: Call System.schedule with a cron trigger in the past, and you will get a stuck job.

I need some help from someone in the Salesforce team to delete the orphaned AsyncApexJobs.

Related: https://developer.salesforce.com/forums/?id=906F0000000BOuqIAG
Related 2: http://avionsalesforce.blogspot.com/2016/03/how-to-terminate-asyncapexjob-exception.html
Best Answer chosen by Andres Schmois
Vishwajeet kumarVishwajeet kumar
Have you tried to abort them from workbench.
Try this and see if it works:
  1.  login to "https://workbench.developerforce.com/login.php" 
  2. On right corner, it will be showing your name and API version. Click on that link
  3. There you will find change API version, change it to 32
  4. Go to Utilities >> Apex Execute
  5. There run this command System.abortjob() with job Id

All Answers

Vishwajeet kumarVishwajeet kumar
Please Log a case to Salesforce Support from your production Org. That's the way salesforce team can help you.
Andres SchmoisAndres Schmois
Well, the correct category for "developer" is grayed out because I'm not a premium member so I just grabbed the next closest thing and was told to post here. I wish I could log a case.
Vishwajeet kumarVishwajeet kumar
Have you tried to abort them from workbench.
Try this and see if it works:
  1.  login to "https://workbench.developerforce.com/login.php" 
  2. On right corner, it will be showing your name and API version. Click on that link
  3. There you will find change API version, change it to 32
  4. Go to Utilities >> Apex Execute
  5. There run this command System.abortjob() with job Id
This was selected as the best answer
Andres SchmoisAndres Schmois
I wasn't going to try it, especially because I have to use a third party tool to fix it, but I got fed up and did it and it worked.

It's a shame a salesforce bug has to be fixed by a third-party tool and treat their users like I was treated for a bug on their platform. Guess that's what they call the Salesforce Way™

Thank you for your time anyways.