2

I am having a need to get and prepare a statistics for the client that would tell them the number of callouts made from each and every user in their org per day basis. I am assuming setting up the debug log for each user and I do not know the limitations of it.

The idea behind is to understand how many hits an webservice got per day so that performance patches can be added to the code. Also to find out which functionality actually the sales rep is trying to use? (this is purely from developer perspective and not on the business side).

Can someone please suggest the best way to achieve this?

Thanks

2

If you want to track who is making what calls and the number of calls being made to each webservice, then you are going to have to write logic to store this information as "snapshot" into a custom sobject. This way you can get a report on a daily basis of what is being used. If you just care about what your current limit is, you can do what @AllenLi suggeted which is to use the getLimitCallouts() method.

0

You can use static method getLimitCallouts of Limits class. Check this: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_limits.htm

2
  • 1
    This will not give the desired answer, this will give the number of remaining call-outs within the current execution context, i.e. it will return 10 when a new execution starts. It will reset as soon as the execution end. A single user will have many contexts over the course of a day, one each time they interact with Salesforce.
    – Doug B
    Jul 14 '14 at 13:36
  • Yes, that's true. Maybe you can create a customer setting object to store each user's callout number, then update it when a callout happens. This is just my idea, if you have a better solution, please let me know.
    – Allen Li
    Jul 14 '14 at 13:49

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.