• : 1-877-596-8218
  • : sales@aecc.ca
# # #
#

Advanced PDF using NetSuite.

Advanced PDF templates allow the user to customize the transaction PDF templates that will be used to generate and send to customers. With this feature, the user can make their own style and add the required information on the PDF of transactions.

To access this feature, please go to the Customization -> Forms -> Advanced PDF/HTML Templates. Please note that, the Advanced PDF templates are tied to the form level of the transactions, you can define a specific form that uses a certain Advanced PDF template by clicking the Customize -> Customize the form one the top right on the transaction page.

The advanced PDF templates utilize the FreeMarker Engine to generate PDF files on the server side, which means users have no access to write the backend logic when customize the PDF templates using SuiteScript/Javascript. This will be an issue sometimes when user want to build a complex templates.

The good news is, one can build a SuiteLet and put all the back-end logics into it, and in the Advanced PDF template, calling this SuiteLet to display the data from the SuitLet.

Let’s start from creating a simple SuiteLet.
/**
* Created by Zhuang Liu on 2017-02-28.
*/

function liu(request, response){
var a = ‘This is the return data from AE_SL_test’;
response.write(a);
}
This simple SuiteLet just write a string to the response which will be received by the caller (The Advanced PDF template). Then in the advanced PDF template, use the following syntax to call the SuiteLet and add the result from the suiteLet and display in the PDF:
<#include "https://forms.na1.netsuite.com/app/site/hosting/scriptlet.nl?script=404&deploy=1&compid=TSTDRV1331860&h=8fc958ecb411d83dc02e">

Please note that, the SuiteLet must be released and the Deployment record must has the “Available Without Login” checkbox checked, in order to make the suitelet available to be called by the FreeMarker Engine.
If we add this line into the template, the result PDF generated using advanced PDF will be