I am working on printing a transaction form using ...
# suitescript
k
I am working on printing a transaction form using a custom Advanced PDF. I have applied the PDF to the transaction form. In my suitelet, I am using the following:
Copy code
var	renderer  = render.create();
renderer.addRecord('record', record.load({
   type: record_type,
   id: invoiceId.id
}));
var invoicePDF = renderer.renderAsPdf();
I am getting an error : "Missing parameters required to generate PDF" Any thoughts?
u
https:///app/help/helpcenter.nl?fid=section_4412065265.html
Copy code
var xmlTmplFile = file.load('Templates/PDF Templates/invoicePDFTemplate.xml');
var myFile = render.create();
myFile.templateContent = xmlTplFile.getContents();
myFile.addRecord('record', record.load({
    type: record.Type.INVOICE,
    id: 37
    }));
var invoicePdf = myFile.renderAsPdf();
k
for the file.load(), I don't have a file to refence, the Advanced PDF is already assigned to the transaction record..
s
You still need to tell the renderer what template you want to use I believe. maybe try using https://system.na0.netsuite.com/app/help/helpcenter.nl?fid=section_4528552999.html
j
Have you looked at render.transaction instead that can generate a PDF file using the template associated with the form.
👍 2
k
@JohnnyC, I am going to have to add a custom data source, I am not positive render.transaction will support.
j
No it won't then what @Sandii said is correct you have to provide the renderer with the template string
or by using the template id as indicated by the help link provided
👍 1
196 Views