Hello everyonbe I'm trying to create a custom PDF ...
# suitescript
s
Hello everyonbe I'm trying to create a custom PDF template through script and I'm getting an error of a Missing parameter for PDF id, this is not intended to load any created template in the backend just a custom string. There is no documentation that provides insight on how to add an id to the renderer, all the examples just do this. type: "internal error", code: "MISSING_PDF_PARAMETERS", details: "Missing parameters required to generate PDF",
const renderer = render.create();
recordArray.forEach(function(rec){
renderer.addRecord(rec.alias,rec.recordObj)
})
renderer.templateContent = templateString;
const pdf = renderer.renderAsPdf();
pdf.name = fileName
return pdf;
I created logs and the renderer is null on the logs of the script.
m
Are you trying to add records to the template like the example?
s
@Matt Carter Yes I figured out what the issue is, seems that I need to add the nsfonts as a parameter to the renderer and that is causing the issues, as the template string contains this parameter.
m
Ah, yes that will do it. Just love how informative NetSuite error messages are.