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
Sushma R IyerSushma R Iyer 

System.AsyncException You have exceeded the limit of 100 Jobs in the flex queue

Hi All,

While creating a Lead or while Editing an Account most of the users
are getting the below Error message :
User-added image
Hi All,

As mentioned in the below links to contact Salesforce Support , but we couldnt contact them as since we have a standard support contract and they support Apex issues only on premium support contract:

https://help.salesforce.com/articleView?id=000213851&type=1
https://success.salesforce.com/issues_view?id=a1p3A0000008g2NQAQ
https://success.salesforce.com/issues_view?id=a1p300000008YgIAAU 

Also I tried to implement the workaround suggested as in the below link but that gave me errors related to other classes so was unable to deploy it :

https://developer.salesforce.com/forums/?id=9060G000000MTVgQAO

So as a Temporary fix though its not recommended to Abort the Holding jobs we are aborting it for the users to carry on with their activities.

Hence if anyone have had the same situation kindly help me...!
Thanks in Advance...!

 
Best Answer chosen by Sushma R Iyer
Sushma R IyerSushma R Iyer
Hi All,

The above issue was solved by raising a case with Salesforce Support & getting the queued jobs/tokens deleted by them.

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Sushma,

Without waiting for the exception to be thrown, you have to burn a query. I believe the following query should suffice:
Integer flexQueueSize = [SELECT COUNT() FROM AsyncApexJob WHERE Status = 'Holding' FOR UPDATE];
Using FOR UPDATE ensures that you have the correct value of the queue, pending any other requests in flight.

Please let us know if this helps.

Happy to help further.

Thanks,
Nagendra
Sushma R IyerSushma R Iyer
Hi Nagendra,

By using your query i got to know that there are 4 ApexAsync Jobs.But the question is why is it going in Holding Status suddenly which was not going earlier.How to stop it from going to avoid continous monitoring of jobs & aborting them for smooth functioning.
Sushma R IyerSushma R Iyer
Hi All,

The above issue was solved by raising a case with Salesforce Support & getting the queued jobs/tokens deleted by them.
This was selected as the best answer