Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

The organization that I am working for has a trigger in a case that calls some code in a class called Cases.cls. I modified the code, but in trying to deploy I keep getting an error: pending batch or future calls.

I found 17 future jobs that are queued - since 2010!! There was one that had the text 'abort' next to it, and I was able to do so, but I don't see any way to cancel the rest of them.

I tried retrieving one of the jobs via the developer console and was successful, but it did not allow any DML statements.

Does anyone have any idea how I can remove the queued jobs so that I can deploy my changes?

1 Answer

0 votes
by (32.1k points)

Instead of attempting to delete the job record via DML, try using the System.abortJob(String job_Id) method from the developer console. 

If that doesn't work, I would recommend you for contacting SFDC support, as that's most likely an internal issue on their side (our future jobs typically run within seconds of being called, so I can't imagine the circumstances that would cause a job to remain pending after two years...)

To learn in-depth about Salesforce, sign up for an industry based Salesforce Training.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...