JavaScript Remoting from Skuid page launched from custom OnClick JavaScript button/link


For this use case, I launch my Skuid page using the following JavaScript:

{!REQUIRESCRIPT("......")}<br>var url = '/apex/skuid__UI?page=AwesomeSkuidPage&amp;id=' + '{!sobject.Id}';&nbsp;<br>window.location.href = url;

On the awesome Skuid page, I have a page title button that performs even more awesomeness. The button Runs Multiple Actions that executes a JavaScript snippet which uses JavaScript remoting to invoke a remote action.  Note that the remote action must be asynchronous.

I do not want to include an Apex VisualForce page in order to include the necessary JavaScript ala

Is this possible?  I am relegated to implementing a custom REST service?

Thanks in advance,

Irvin have you read this post:

I’m not sure I know all the options,  but from that post it looks like you may have at least one “non-webservice” option. 

Read the post this morning.  I am going with Option 2 at the moment.  Just repackaged my RemoteAction into a HttpGet.  Not quite sure how to get the server instance, however.

$.ajax({&nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp;type: "GET",<br>&nbsp; &nbsp; &nbsp; &nbsp; url: "??????", &nbsp; &lt;-- how to get the server URL?<br>&nbsp; &nbsp; &nbsp; &nbsp; beforeSend: function (xhr) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xhr.setRequestHeader('Authorization', "Bearer" + sforce.connection.sessionId); &lt;-- is this correct?<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xhr.setRequestHeader('Accept', "application/json");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xhr.setRequestHeader('Access-Control-Allow-Origin', '*');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xhr.setRequestHeader('Access-Control-Allow-Methods', 'GET');<br>&nbsp; &nbsp; &nbsp; &nbsp; },<br>&nbsp; &nbsp; &nbsp; &nbsp; success: function (data) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(data);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deferred.resolve();<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; });

For others that may run into a similar use case, please consult this tutorial page:…

This tutorial describes how to use the Visualforce component approach where you create your own Visualforce Page and use the Skuid.Page component. This has the benefit of injecting the proper JavaScript into the page so that JavaScript remoting works.