I am working on calling APEX classes. (Ultimately I need to get a List into snippet.
I am trying all 4 methods outlined in https://community.skuid.com/t/calling-apex-function (the seminal post). In this question I am trying to understand using @remoteAction (method #4). In this post
and https://community.skuid.com/t/problem-in-calling-apex-function or https://community.skuid.com/t/how-to-display-data-returned-by-apex-class the syntax of the code provide seems to say that you can fo something like:
var newAccount = MyApexClass.createAccount('Acme Generators');
I actually get a remoting error. I know this can be handled with callback but, i am curious how the examples are getting values out of call.
my example remote method is:
public with sharing class whyNotWork {
public whyNotWork(ApexPages.StandardController controller) {
}
@remoteAction
public static String showIt(String a){
String b = a +‘hello’;
return b;
}
}
since I would like to capture the value in the snippet the other posts’ example would be easiest. Not sure how it is working in those cases. My snippet makes call just fine but since async I can’t seem to get value. no matter how much waiting or using .done().
What am I missing? Thanks so much.