I have an action sequence that I’m using as a row action today. It works flawlessly.
I’d like end users to be able to multi-select rows and run the action sequence on each row.
For the action sequence to work, I pass in the DocumentId from the Document__c field to a named input called “document”. That works without issue as a row action.
Here’s the javascript I created to loop through each selected row. It appears the action sequence runs but there is now Id passed to the “document” named input.
Any guidance on changes I can make would be greatly appreciated.
var params =argumentsa0];
var $ = skuid.$;
var models = skuid.model.map();
// Get the Document IDs from each selected record
var Ids = skuid.$.map(arguments.0].list.getSelectedItems(),function(item){
return item.row.Document__c;
});
console.log(Ids);
// Loop through each record to download the attachments/documents
$.each(Ids,function(i,row){
var namedInputs = {
“document” : Document__c,
};
skuid.actionSequences.getByName(“DocumentDownload”).run(namedInputs);
});