NetSuite uses the popular Java reporting tool produced by Big Faceless Organization (BFO) to produce crisp documents that can be easily printed, emailed and sent in a PDF format. Using the built-in Advanced PDF Templates, you can create robust looking documents tailored to your business needs—without  making costly advanced customizations.

To create stunning documents, you will need a bit of HTML knowledge and a familiarity with the template language used by the BFO report generator called FreeMarker. We are going to walk through a simple customization that allows users to choose which items will print on a Netsuite Sales Order.

People often need to include items on sales orders they don’t want their customers to see on a printed document. Sometimes this is used to include a Gift with Purchase (GWP) but not show the actual item line since the description might contain a marketing blurb. Some are meant to be messages for warehouse pickers with directions about the product purchased. Others use it to include detailed product information or components that are sold in a kit.

In cases like this, you need to be able to select which items print on sales orders and which don’t. Here are simple instructions on how to achieve this.

Step 1: Add a custom column field to a sales order to indicate whether an item will print or not

  1. Add a check box field that defaults to being checked on the sales order. I labeled mine “Prints on Sales Order.”
    Advanced PDF templates NetSuite Create Field
  2. After the field was added, I went to the sales order form to position my field in the line item list. To do this go to Customization à Transaction Forms and select Standard Sales Order. I found my column on the Screen Fields – Columns tab. From here I was able to drag the handle to the position I wanted my field to appear.

Add Checkbox transaction field to form

This is the sales order form with the Print on Sales Order custom column.

NetSuite Custom Transaction column

In this example I selected the first and third lines to print and omitted the 2nd line. My test scenario was a GWP.

Step 2: Modify the Sales Order Advanced PDF Template to “look” at your custom field when printing line items

  1. Modify the sales order template so it “looks” at your new field(s) by navigating to Customizations à Forms à Advanced PDF Templates. I selected the template for my sales order.Note: To get to the markup language, you have to accept the warning after hitting the “Source Code” button.Advanced PDF editor NetSuite UI
    Once you are viewing the source code, you can see a combination of HTML and FreeMarker. FreeMarker is the template engine used by BFO to manipulate PDF files produced by Netsuite. Since it’s based on an HTML form, it’s broken up like any standard HTML form except it’s enclosed in a <pdf> tag. There are still  <HEAD> and <BODY> sections and style sheets are still used to manipulate the appearance.
  2. Navigate to a table that prints the lines items. You can use a search (Ctrl F) of “record.item” to find tables. I noticed a table row is printed for every line item. To control whether the row prints, surround the row with a FreeMarker if condition to test if the “Print on Sales Order” field was checked.  Note, since this field was of data type checkbox, I had to first cast it as a string to see if the column was actually checked.
    Freemaker Code NetSuite Advanced PDF Template
  3. Save your template and use the template formatting tool to validate your changes.

Next, I went to my custom form and selected the template I just modified. This tells Netsuite you are using this template on this custom form.

Custom Transaction form NetSuite

Now all that’s left is to check to see if it worked. I went to the sales order list and selected to print the sales order I just entered for my test.

Custom Advanced PDF Sales Order Template NetSuite

You can see the first line and the third line printed, but the second line (i.e., the free chair) was omitted just as we wanted.

With a little HTML knowledge and some FreeMarker syntax, you can create robust documents from NetSuite that not only look good, but extend functionality for an ever-changing business.

If you’re interested in learning more about building Advanced PDF documents in NetSuite – or are looking to get more out of your NetSuite investment in general, our team is more than happy to help.  Thanks for stopping by!

Want to ensure your business is getting the most out of your NetSuite usage and investment? Learn more about our NetSuite Support services.

Additional NetSuite Resources

6 Tips for NetSuite Advanced PDF Templates

How to Create an ‘After Field Edit’ Trigger on NetSuite Workflow Actions