Cannot delete AsyncApexJob using System.abortJob
EXCEPTION: System.StringException: You can't abort scheduled apex jobs by calling system.abortjob with an AsyncApexJob ID.
You must call system.abortjob with the parent CronTrigger ID.
I tried same in workbench with lowed api version then it worked. I was able to delete 2 jobs in API version 32. Follow these steps to run this statement:
- login to "https://workbench.developerforce.com/login.php"
- On right corner, it will be showing your name and API version. Click on that link
- There you will find change API version, change it to 32
- Go to Utilities >> Apex Execute There run this command with job Id
I believe this would help you. Please let me know if you have any other questions, I would love to help you in that as well.
Turns out that I had to open a case with Salesforce to solve this. After more than 10 days, and two escalations, they didn't solve the issue. Since I didn't want to waste more time waiting for a miracle, I suggested the exclusion of the entire development environment (the sandbox) and creation of a new one.
This solved the problem, with the downside of erasing every customization I did and didn't push to the production environment. Fortunately I know how to use the Migration Tool, so I could save most of my work.
You may have to contact Salesforce support to fix this. They may be able to kill that queued job. We've had a similar issue in the past and we could only solve it by contacting SF.