Skip to main content

I have a very basic requirement. Take inputs from the user (as of now trying to take only one input) and insert the value in a custom object. 

Following is the JS code:-

var applicationModel = skuid.model.getModel(‘Application’);var applicationRow = applicationModel.data.0];
var result = sforce.apex.execute(‘ApplicationMasterController’,‘checkPassedValueFromPage’,
{
appFromSkuid: applicationRow
}
);

The ApplicationMasterController just has 2 lines of code viz.

webservice static String checkPassedValueFromPage(customObject appFromSkuid) {    
    return ‘tested the flow from Skuid Page’;
    }

the method does return the string but on the browser console there is an error which states “No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://c.cs6.visual.force.com’ is therefore not allowed access.”

I have even tried whitelisting the link. but does not help.

Any pointeres for this issue  and Is there any other way to achieve this requirement other than what I have tried??


Regards,
Gautam.

Hi, Gautam,
This is just a guess, but did you reference the AJAX toolkit as an external resource in your Skuid page. It’s an extra step needed in order to call an Apex webservice method from your Skuid page, and you may have already done this. If you haven’t, add a new JS resource of type “External Resource” and use this as your Resource URL:
 /soap/ajax/olatest_api_version]/apex.js (for example,  /soap/ajax/34.0/apex.js ). That might fix the problem for you. Also, this community post has some great information on different ways to call Apex from Skuid.
https://community.skuid.com/t/calling-apex-function

Hope that helps!
Emily


Reply