You need to sign in to do that
Don't have an account?

Accessing class functions and variables from RemoteAction function
Hi,
I'm trying to access a class function from a RemoteAction function.
The function I was trying to access is not static, while the RemoteAction function must be static. This causes the "Method does not exist or incorrect signature" error.
So I changed the function I was calling to be static, which gets rid of that error. But that creates a new error, because the function is trying to call an instance variable which is not static - "Variable does not exist". Addiing static to that variable does not change anything.
Something like this:
global with sharing class MyClass { public static String myVar {get;set;} public static void myClassFunction(String id){ myVar = ''; } @RemoteAction global static string updateRecord(String id){ myClassFunction(id); return '1'; } }
What's the right way to do this?
It's still saying MyVar doesn't exist after you have added static to it?
You should probably log a case if that's still and actually the case. That seems incorrect to me.