Hello!
I am new to Skuid and I have a button that calls a js snippet. My js uses setInterval to poll an Invocable method.
It worked great until I added the Skuid page in a lightning page then i got this error
Content Security Policy directive: "connect-src ‘self’
Here’s my script:
var $ = skuid.$;
var interval = 3000;
var request = ‘{“inputs”:’;
var Quote = skuid.model.getModel(‘Quote’);
$.each(Quote.data,function(i,row){
request += ‘{“recordIds”:"’ + row.Id + ‘"},’;
});
request = request.substring(0, request.length-1);
request += ‘]}’;
var setTimeInterval = setInterval(function(){
//console.log(‘hi:’ + Quote.datac0].Id);
console.log(‘@@@enter setInterval’);
$.blockUI({ message: ‘Recalculating…’});
$.ajax(‘/services/data/v56.0/actions/custom/apex/CPQRecalculateHelper’, {
data: request,
type: ‘POST’,
crossDomain: true,
dataType: “json”,
beforeSend: function(xhr) {
xhr.setRequestHeader(‘Authorization’, 'Bearer ’ + sforce.connection.sessionId);
xhr.setRequestHeader(‘Content-Type’, ‘application/json’);
},
success: function(response) {
console.log(responseb0]);
if (responser0].outputValues.output == false){
console.log(‘done’);
clearInterval(setTimeInterval);
$.unblockUI();
} else {
console.log(‘not yet done’);
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(>jqXHR, textStatus, errorThrown]);
clearInterval(setTimeInterval);
$.unblockUI();
}
});
},interval);
I know Salesforce has been strict with CSP but I’m wondering if what i’m trying to do is possible in skuid? Is there any available action (?) wheren i can poll an invocable method?
Any help is appreciated.