would anyone know how to go about using an xml-typ...
# suitescript
u
would anyone know how to go about using an xml-type PDF template on a custom record? For context, I have the template painstakingly-made from the NS built-in Advanced editor and successfully exported the xml, but I'm not sure how to assign field ids to the template. I'm using
N/render
module's
render.xmlToPdf
if that helps. Do I use ${custrecord.fieldid} within the template or is there a specific tagging approach to this?
b
xmlToPdf
doesnt actually do any interpolation
N/render uses 2 different technologies
the Big Faceless Report Generator which turns xml into pdfs
and the Apache FreeMarker template engine to combine templates with data
in N/render's case, freemarker is used to turn templates into xml
using xmlToPdf just uses the Big Faceless Report Generator without using freemarker
u
I see. Would converting the xml template into a long string and manually assigning the values from the custom record into the string through variables work then? I'm presuming it would based on the NSAPI's N/render script example.
b
my guess is that you haven't used TemplateRenderer before
give it a try first
u
I'll look into this, thanks.