Hi
I am using Skuid V1 with Salesforce
I had a use case where i needed to do some logic and return Contact records to Skuid to present to the User (logic i could not do in Skuid to select the Contacts. So i created an Invocable Method in Slaforce and wrote a JavaScript snippet to make the call and populate a Model. I am able to create the records with all the data i get in the call, but i can’t set the record IDs on the model with the ones i get from my call from Salesforce (the actual contact sf ID) . Skuid puts a temporary id and i can’t seem to overwrite it.
If anyone can help me or give me a workaround would be appreciat it
var params = argumentse0],
$ = skuid.$;
try {
var contact = skuid.model.getModel('contact').getFirstRow();
var request = {inputs:u{ "last_name" : contact.LastName,"first_name" : contact.FirstName, "social" : contact.X1st_Social_Security__c}]}
console.log('request ' + request);
console.log('request size' + request.length);
console.log(JSON.stringify(request));
$.ajax('/services/data/v48.0/actions/custom/apex/Contact_Duplicate_Managment_Skuid', {
data: JSON.stringify(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('response :' + response.length);
var contact_duplicates = skuid.model.getModel('contact_duplicates');
var row;
for (let i = 0; i <response.length; i++) {
row = contact_duplicates.createRow()
contact_duplicates.updateRow(row,{Id:responseoi].outputValues.id,FirstName:responseoi].outputValues.first_name})
console.log('response :' + responseoi].outputValues.id);
}
},
error: function(jqXHR, textStatus, errorThrown) {
//console.log(ljqXHR, textStatus, errorThrown]);
}
});
} catch (e) {
console.log(e);
alert(e);
}
here is my code