How to call my Apex class and method from javascript snippet

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Photo of Matrix

Matrix

  • 590 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Matrix,

There is a community post on how call Apex from JavaScript here:  https://community.skuid.com/skuid/topics/calling_apex_function

You should also consider making your Apex class 'invocable', because this approach will make your class 'callable' from any Skuid action.  You'd then be able to use your Apex class on any Skuid page without adding any JavaScript.

Thanks,

Bill
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Here's our documentation about calling Apex actions from Skuid, if you're interested. 

Thanks!
(Edited)
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 1,312 Points 1k badge 2x thumb
Hi Amy, That link actually doesn't show anything on APEX. Ironically even though I have invocable classes neither the option to even select option in Action Framework doesn't show-up
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Oops, let me fix that. That's a side effect of us moving our documentation site. Some of the links still redirect fine but others didn't quite make it. I've fixed the link above so that it goes to the correct documentation, just look for the section about Apex. It's admittedly a short blurb, but it also links to some Salesforce documentation about invocable methods. 

To help troubleshoot your issue I have some questions for you:
What version of Skuid are you on?
Can you give some more details about "the option to select doesn't show up", and maybe a screenshot? Can you not run the Apex datasource action or can you not select any Apex actions to run?

Thanks!
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
Looks like I spoke too soon; Bill helped you to find the run Apex action. Glad you got it sorted out, nevermind about my questions!