Javascript Parameters Passed to field in Wizard component

  • 1
  • Question
  • Updated 2 years ago
Hello all! I am trying to replicate an OnClick JavaScript button we have in Salesforce to work in Skuid. The OnClick JavaScript button in Salesforce runs apex, then opens a create event page with the Assigned To field populated from the logic in the apex code

We are having trouble recreating this in skuid. The workaround I currently have in place:
1. A row action that runs a JS snippet, passes model values from the row you initiated the actions for, then opens the create event page in salesforce

The issue with this workaround is that it takes our users out of the skuid view and they lose their place in their workflow. 

The ideal process would be clicking a button that runs multiple actions:
1. Runs the JS snippet with apex logic
2. Launches a Wizard component to create an Event, with a field in the field editor of the wizard populated from the logic launched in step 1

Unfortunately I am not JS savvy and I cannot figure out how to pass the JS/apex values to the skuid field. I found this tutorial that describes what I want, but I couldn't follow the example exactly http://help.skuid.com/m/11720/l/218340-wizard-component-custom-button-actions. The given example was for validate required fields on models from a snippet, not populating fields on models from a snippet.

Any help or further resources to get this process in skuid would be huge! 

Thank you
Photo of Lauren Kemp - Procore

Posted 2 years ago

  • 1
Photo of Jacob Cohen

Jacob Cohen, Employee

  • 142 Points 100 badge 2x thumb
Hey Lauren,

On this one, Is it possible to make the Apex available as Invocable? Of the four possible ways, that is the Preferred Method for calling Apex from Skuid.
Beyond that you can make the Apex available with js Remoting, as a web service, and even as a REST service.

Once you have any of those set up you can run your apex as a step in the action framework. For the Invocable this would be declarative, while the web service and remoting will require a tiny bit of js. The REST service is actually accessible as a datasource.

It is possible to pre-populate the values in the launched wizard, but the execution depends on the way you called apex. Much like above— the Invocable will work in the action framework, the remoting and web service will require a small amount of js, and the REST service's data will be available in the data model on the Skuid page.