You need to sign in to do that
Don't have an account?
Extending the scope of static variable
I have a VF page and an extension class to extend the standard controller. I need to have a global variable in the apex class which keeps incrementing by 1 each time a particular function is accessed. As the scope of 'static' is limited to a request, i'm not able to track the count. Can anybody help?
i thing here you can use the custom object and you can save the counter in object and when function is accessed you increment the counter and update the object again.
OR
if you want to work only on page level then you can use this technique:
Then in VF page u can simply use {!counter}
no need of use static variable, as it will directly increase the counter variable and finally u will get the number of functions called.