ericbirdsall
07/14/2023, 9:18 PMericbirdsall
07/14/2023, 9:20 PMarrFulfillmentIds.forEach(( fulfillmentId ) => {
const objPackingSlipFile = render.packingSlip({
entityId: fulfillmentId,
printMode: render.PrintMode.PDF,
});
objPackingSlipFile.folder = -15;
objPackingSlipFile.name = `PackingSlip-${fulfillmentId}.pdf`;
objPackingSlipFile.isOnline = true;
const stPackingSlipId = objPackingSlipFile.save();
arrFileIds.push( stPackingSlipId );
});
SL.renderSinglePDF = ( fileIds ) => {
const xmlLines = [ "<?xml version=\"1.0\"?>", "<pdfset>" ];
fileIds.forEach(( fileId ) => {
const singlePDF = file.load({ id: fileId });
const stPDFURL = xml.escape({ xmlText: singlePDF.url });
xmlLines.push( `<pdf src='<https://XXXXXX-sb1.app.netsuite.com>${stPDFURL}'/>` );
});
xmlLines.push( "</pdfset>" );
return render.xmlToPdf({
xmlString: xmlLines.join( "\n" ),
});
};
This works, but forces me to use a ton of governance for file.save / file.load
Wondering if there is a way around that?battk
07/14/2023, 10:40 PMbattk
07/14/2023, 10:41 PMbattk
07/14/2023, 10:43 PMericbirdsall
07/15/2023, 1:35 PMbattk
07/15/2023, 10:05 PMbattk
07/15/2023, 10:07 PMericbirdsall
07/16/2023, 12:31 PM