MRJG
06/27/2023, 3:45 PMDavid B
06/28/2023, 1:50 AMN/render
. Are you using render.transaction
or render.packingSlip
?
I haven't tested, but presume the latter would solve your issue.
Would be interested to know if that's the case, please let me knowMRJG
06/28/2023, 2:08 AMif (recordId) {
const fulfillmentRecord = nRecord.load({
type: nRecord.Type.ITEM_FULFILLMENT,
id: recordId
});
const ftlTmplFile = nFile.load('Templates/PDF Templates/NEW-Commercial Invoice Packing Slip.ftl');
const renderer = nRender.create();
renderer.templateContent = ftlTmplFile.getContents();
renderer.addRecord('record', fulfillmentRecord);
const pdfFile = renderer.renderAsPdf();
context.response.writeFile({
file: pdfFile,
isInline: true
});
}
David B
06/28/2023, 2:10 AMMRJG
06/28/2023, 2:10 AMDavid B
06/28/2023, 2:11 AMMRJG
06/28/2023, 2:13 AMDavid B
06/28/2023, 2:15 AMformId
instead of a template directly.
So you'd have to have a form (could be the default form) that had your packing slip template on it.
As opposed to using the Render.TemplateRenderer
, where you can specify the templateContent
property directly from a ftl template file's contents (as you are currently doing).MRJG
06/28/2023, 2:17 AM