We went the snippet route! (Although the Action Sequence is a really interesting idea.) And by “we”, I mean my developer, because I do not do the fancy things. She wrote the Apex, so I just followed her lead…
For anyone with the same need, here’s the snippet (she borrowed some of it from another post, but I can’t find it now!). (Errr…I think there’s a better way to post this, but I don’t know what that is.)
var params = arguments[0],
$ = skuid.$;
try {
console.log(arguments);
var params = arguments[0],
$ = skuid.$;
var request = '{"inputs":[';
var Approvals_Mine_RelatedtoQueue = skuid.model.getModel('Approvals_Mine_RelatedtoQueue');
$.each(Approvals_Mine_RelatedtoQueue.data,function(i,row){
request += '{"recordIds":"' + row.Id + '"},';
});
request = request.substring(0, request.length-1);
request += ']}';
$.ajax('/services/data/v56.0/actions/custom/apex/MassApprovalHelper', {
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(response);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log([jqXHR, textStatus, errorThrown]);
}
});
}
catch(e) {
console.log(e);
alert(e);
}