APEX controller is not defined

edited February 25, 2019 in Questions
I need a smack upside the head from the Skuid community.

I am getting a different experience in two environments calling an apex controller - but the APEX class and my skuid page are identical. APEX class has the same permissions. I am using @RemoteAction and calling via

MyClassName.DoSomething(String AccountId)

I verified that the account Id is being passed in. 

One environment works great and another gives me:

Uncaught ReferenceError: MyClassName is not defined
    at ui?page=MySkuidPage&id=001500000100000AAF:335
    at HTMLDivElement.<anonymous> (skuid__SkuidReqsJS:1)
    at HTMLDivElement.ee (skuid__SkuidReqsJS:1)
    at HTMLDivElement.dispatch (skuid__VendorJS:2)
    at HTMLDivElement.q.handle (skuid__VendorJS:2)

Before I start pulling things apart, any thoughts on what could be causing this? #feelingdumb


  • edited February 25, 2019
    Are your Skuid versions the same?  Are both environments running Lightning Experience?

    If your non working version is a new page (recently copied?), maybe try to click Generate Page Resources?

    Are you declaring your MyClassName before using it? 
    var MyClassName = MyClassName.DoSomething(String AccountId);

    Locker Services requires you to declare everything.
  • edited October 16, 2018
    Ah! I am in classic for both environments but one has lightning enabled and the other does not.   
  • edited October 16, 2018
    Welp, declaring didn't help.  I wonder if this is a skuid version issue.  We are on different versions of Milau 11.2.8 (not working) and 11.1.13 (working). That's probably the cause.  Not seeing anything in the release notes yet. 
  • edited October 17, 2018
    Could still be a locker service issue, where calling apex from within JS doesn't work anymore.  We moved ours to action sequences, and then call the action sequence from JS instead of directly calling the apex class.

    Here's a post from my colleague when we made the switch, and some links to resources are in the post.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!