So, I'm loving the new Advanced PDF Templates and the associated SuiteScript API methods. However, there's a pretty large shortcoming .. unless I'm missing something.
Take this example, for instance ... from Netsuite's documentation
<span style="color:'#484848'"><span style="font-family:'monospace'">[COLOR=#000080]<strong>function</strong></span> <span style="color:'#000000'">renderRecord</span>(request, response) </span>[/COLOR]<span style="color:'#484848'"><span style="font-family:'monospace'">{ </span></span><span style="color:'#000080'"><span style="font-family:'monospace'"><strong>var</strong></span></span><span style="color:'#484848'"><span style="font-family:'monospace'"> salesOrderID = </span></span><span style="color:'#0000FF'"><span style="font-family:'monospace'">3</span></span><span style="color:'#484848'"><span style="font-family:'monospace'">; </span></span><span style="color:'#000080'"><span style="font-family:'monospace'"><strong>var</strong></span></span><span style="color:'#484848'"><span style="font-family:'monospace'"> salesOrder = nlapiLoadRecord(‘salesorder</span></span><span style="color:'#008000'"><span style="font-family:'monospace'"><strong>', salesOrderID); var renderer = nlapiCreateTemplateRenderer(); renderer.setTemplate(…); renderer.addRecord(‘record'</strong></span></span><span style="color:'#484848'"><span style="font-family:'monospace'">, salesOrder); response.setContentType(‘HTMLDOC</span></span><span style="color:'#008000'"><span style="font-family:'monospace'"><strong>'); renderer.renderToResponse(response); }</strong></span></span> My beef is with the .setTemplate method. It wants a RAW string. So, what if I want to use an existing PDF Template?[LIST][*]I could nlapiLoad the template and get the source string ... nope there no such ability to load a template let alone grab its source[/LIST] Ideally, .setTemplate would ALSO accept the Netsuite internalid of the PDF template we wanted to use. This, to me, makes sense.So, what I've had to do is ...[LIST][*]Create the PDF template with the nice WYSIWYG Editor[*]Save[*]View the SOURCE[*]Copy the SOURCE into a File, and save it in the File Cabinet[*]In the script[LIST][*]Load that Saved File[*]Takes its contents and send it into the .setTemplate method[/LIST][/LIST] The issues with this are obvious ... any changes to the PDF Template will NOT be be reflected, until the Source is copied into that file again.Have I missed something? Does anyone else have a more elegant solution?