irurzo
10/13/2021, 5:34 PMlet id = context.request.parameters.id;
let _rcd = record.load({
type: 'estimate',
id: id,
isDynamic: true,
});
let form = _rcd.getValue('customform');
let transactionFile = render.transaction({
entityId: Number(id),
printMode: render.PrintMode.PDF,
formId: Number(form)
});
transactionFile.folder = runtime.getCurrentScript().getParameter({ name: 'custscript_folder_pdf' });
transactionFile.name = _rcd.getValue('tranid') + "_" + _rcd.getValue('title');
let idFile = transactionFile.save();
context.response.sendRedirect({
type: http.RedirectType.MEDIA_ITEM,
identifier: idFile
});
This is the code, when logging the idFile and going to that particular id, the updated value is shown on the PDF but not the file that the button opens, but if I refresh that tab that opens with the PDF it updates the value to the new one. Any idea what Im doing wrong?battk
10/13/2021, 6:41 PM