NetSuite’s Advanced PDF/HTML templates truly empower users with endless options for customizations to printed forms, with the support of FreeMarker. FreeMarker or FreeMarker Template Language (FTL) is an open source Java-based template engine that is used to dynamically render text output in various formats, by providing template processing capabilities and an API that lets users extend or modify FreeMarker’s behavior.
For example, a user has a business requirement to suppress any zero dollar amounts that would appear on an invoice. With the standard PDF templates, this requirement would not be possible. However, with the Advanced PDF/HTML templates, this requirement can easily be achieved by utilizing FreeMarker’s conditional logic.
Here is how this requirement can be achieved:
- Navigate to your Advanced PDF/HTML Invoice Template.
- Go to Customization > Forms > Advanced PDF/HTML Templates.
- Open the invoice template in edit mode and click on the “Source Code” button to view the template’s source code (see below).
- Find the code that outputs the line item amount on the invoice template.
- Alter the code to reflect an “if” statement to ultimately suppress the amount if it equals zero.
- Save the template and print an invoice transaction. Below you will see the before and after effect of adding in the custom FreeMarker conditional logic to the source code of the invoice template.
For more information on customizing your Advanced PDF/HTML Templates, please contact RSM at email@example.com or by phone at 855.437.7202.
By: Chris Corral – Illinois NetSuite Solution Provider