razer456
08/10/2021, 8:33 PMThe Usual Suspect
08/10/2021, 8:35 PMhttps.post.promise({
url: onDemandPaymentSuitelet,
body: onDemandReportCriteria
}).then( function (result){
console.log('response:' + result);
var anchorTag = document.createElement('a');
anchorTag.href = dataEncoding + encodeURIComponent(result.body);
anchorTag.download = reportFileName + fileDateTimstamp.getTime() + fileExt;
document.body.appendChild(anchorTag);
anchorTag.click();
document.body.removeChild(anchorTag);
console.log(result.toString());
}).catch(function (result){
console.log(result.toString());
});
You can create a phantom A element and click it then remove it and it downloads it for the userThe Usual Suspect
08/10/2021, 8:36 PMrazer456
08/10/2021, 8:44 PMThe Usual Suspect
08/10/2021, 10:02 PM