+ Start a Discussion
dmchengdmcheng 

Display the number of future calls that have been made?

So there is a limit of 200 @future method calls per 24-hour period for an organization.  I have a trigger that invokes an @future call and I want to know if I'm running close to the limit.

 

I tried the Limits.getFutureCalls() method in the System Log anonymous block but it returned 0, which I know is not correct.  Is there some other way to find this counter value?  Do I have to put this in the @future code itself and do a system.debug()?  I looked on the Company Information page in Setup but it's not there.

 

Thanks

David

Best Answer chosen by Admin (Salesforce Developers) 
Nick34536345Nick34536345

Unfortunately the Limits methods don't help at all with regard to the 24 hour limit and the count isn't displayed anywhere. Limits.getFutureCalls() tells you how many future calls have been issued in the current "context". There is a getLimitFutureCalls() but again it is just the current context, and will still return 10 when the 24 hour limit is reached. you can browse the future calls in "Apex Jobs" but there isn't total there. So there's no way to know.

 

Note that it is 200 per license per org.

 

 

All Answers

Nick34536345Nick34536345

Unfortunately the Limits methods don't help at all with regard to the 24 hour limit and the count isn't displayed anywhere. Limits.getFutureCalls() tells you how many future calls have been issued in the current "context". There is a getLimitFutureCalls() but again it is just the current context, and will still return 10 when the 24 hour limit is reached. you can browse the future calls in "Apex Jobs" but there isn't total there. So there's no way to know.

 

Note that it is 200 per license per org.

 

 

This was selected as the best answer
dmchengdmcheng

Thanks for your reply.  That's good news on the per license aspect, though I wish Salesforce would clarify that.  Does this mean any type of license, e.g. standard user, portal, platform, etc?

rungerrunger

I would post an idea on the idea exchange for having calls in apex to show those limits, if it's not already there...

Rich