I want to print a pdf by rendering an advanced pdf...
# suitescript
b
I want to print a pdf by rendering an advanced pdf template from the suitelet. I have this code block on my suitelet
Copy code
const renderer = render.create();
renderer.addRecord(
        "record",
        record.load({
          type: recType,
          id: recId,
        })
      );
renderer.setTemplateByScriptId("custtmpl _pi_pdf_template");
const pdfFile = renderer.renderAsPdf();
But the script fails on the last line with the error
MISSING_PDF_PARAMETERS
What am I missing here?
a
well in this snippet your template ID has a space in it, not sure if that was just from anonymizing or also in your code?
🎉 1
b
I feel really stupid right now. Thanks for pointing it out. That resolved it.
👍 1
a
haha sometimes you just need a fresh set of eyes!
👍 1
268 Views