+ Start a Discussion

Variable does not exist: currentCase



In my project, i got the requirement to execute the apex methods from java script. For that, i need to change the existed normal apex method to web service methods to be used in java script.


In my project, the apex controller developed already. while changing the code to web service i am getting the error like:

Variable does not exist.


The variables which are declared with in the class can not be accessed in the method with in the same class.


Please suggest how to change the normal apex to web services.


Thanks in advance.





When coverting a Apex class to webservice, the class has to be defined as global.

Could you please confirm if that is the case in your class?


Also, go through the sample code in the following link  describing a webservice:



This should give you an idea of how a webservice class is created..