Antonio Garcia
11/19/2021, 1:45 PMbattk
11/19/2021, 2:40 PMAntonio Garcia
11/19/2021, 2:42 PMAntonio Garcia
11/19/2021, 2:51 PMbattk
11/19/2021, 3:03 PMbattk
11/19/2021, 3:05 PMbattk
11/19/2021, 3:05 PMAntonio Garcia
11/19/2021, 3:05 PMAntonio Garcia
11/19/2021, 3:06 PMbattk
11/19/2021, 3:06 PMAntonio Garcia
11/19/2021, 3:07 PMAntonio Garcia
11/19/2021, 3:07 PMbattk
11/19/2021, 3:08 PMbattk
11/19/2021, 3:09 PMAntonio Garcia
11/19/2021, 3:10 PMAntonio Garcia
11/19/2021, 3:10 PMbattk
11/19/2021, 3:12 PMtemplateName
Antonio Garcia
11/19/2021, 3:13 PMAntonio Garcia
11/19/2021, 3:13 PMAntonio Garcia
11/19/2021, 3:13 PMAntonio Garcia
11/19/2021, 3:26 PMAntonio Garcia
11/19/2021, 3:26 PMAntonio Garcia
11/19/2021, 3:32 PMAntonio Garcia
11/19/2021, 3:32 PM// prepare render object with invoice record and subsidiary record
const rendererObj = render.create();
const invoiceRecord = record.load({
type: record.Type.INVOICE,
id: nsInvoiceId,
isDynamic: false,
});
rendererObj.addRecord({ templateName: "record", record: invoiceRecord });
const subsidiaryRecord = record.load({
type: record.Type.SUBSIDIARY,
id: invoiceRecord.getValue("subsidiary"),
isDynamic: false,
});
rendererObj.addRecord({ templateName: "subsidiary", record: subsidiaryRecord });
rendererObj.setTemplateByScriptId({ scriptId: InvoiceAPISettings.InvoiceAdvancedPDFTemplateScriptId });
// render PDF file and save it to folder
const invoicePDFile = rendererObj.renderAsPdf();
Antonio Garcia
11/19/2021, 3:32 PM