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
Brandon H. BarrBrandon H. Barr 

Status of System.limits.getLimitAsyncCalls()

The Summer 16 documentation lists System.limits.getLimitAsyncCalls() a part of the new method to go along with combined limit on asyncs. From the release documentation, it seems as if that limit, and this method, is generally available. When looking in the API documentation, System.limits.getLimitAsyncCalls() still says that it is reserved for future use.

Summer 15 Doc for Reference

Not to rely on documentation alone, I attempted to schedule more the 50 @future calls but was presented with an error for scheduling more than 50 @futures.  When calling System.limits.getLimitAsyncCalls() it lists the limit as 50.

From my understanding, this the new limit is 200 asynchonous calls of any combination of the following:

  • Methods with the future annotation (@future)
  • Jobs added to the queue with the System.enqueueJob method
  • Classes scheduled concurrently with the System.schedule method
  • Batch Apex jobs scheduled with the Database.executeBatch method
Am I not understanding something correctly? Is the API documentation correct and this was not actually rolled out and is still being reserved for future use? Appreciate the help!
Martijn SchwarzerMartijn Schwarzer
HI Brandon,

I'm not sure why you get 50 as a result. When I execute the following line of code in my dev console I get 200 as response:
 
system.debug('Limit of Async calls: ' + Limits.getLimitAsyncCalls());

Result:

Async Limit debug

Summer 16 should be rolled out by now. Perhaps you are (for some strange reason) still on Spring 16 release?

Best regards,
Martijn Schwärzer
Jaap ScheperJaap Scheper
Hi Brandon,
You were looking for the method
Limits.getLimitFutureCalls();
As you can read in in the docs, getLimitAsyncCalls() (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_limits.htm#apex_System_limits_getLimitAsyncCalls) is reserved for future use.