I keep searching and I can't seem to find it, I need to output the number of SOQL Statements used at a given point in my class (to make my class more efficient), something like:

System.debug('Count of SOQL Queries used: '+__);

I know it's possible but I can't find a link to the docs.

Thanks to @Adrian Larson for quickly solving my mental block!!!

Limits Class


It's the Limits class:

Integer queriesUsed = Limits.getQueries();
| improve this answer | |
  • Thank you! I'll add documentation to my original question – jordan.baucke Sep 15 '16 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.