ANS-0169 · SAVED SEARCHES & FORMULAS

How to Create a Custom Print Link in a NetSuite Saved Search

This guide outlines a method to add a direct print option to NetSuite records via a saved search and a custom form field, enabling browser-based printing.

Short answer

To add a custom print link, create a saved search with a Formula (HTML) column containing a URL that includes a custom parameter. Then, create an Inline HTML custom field on the target record's form. This field's default value should contain JavaScript that triggers the browser's print dialogue when the custom URL parameter is detected.

Scenario

Users often require a quick and direct method to print specific NetSuite records from a saved search result. Standard NetSuite printing options may not always align with specific workflow needs, necessitating a custom solution to trigger a browser's print function directly from a generated URL.

Solution

To implement a custom print link in a NetSuite saved search, follow these steps:

  1. Create a saved search with a Formula (HTML) result column. This column should contain a URL designed to open the record and include a custom parameter to signal the print action. For example, to print an item record, the formula would be:

'<a href"https://system.netsuite.com/app/common/item/item.nl?id'||{internalid}||'&cf&unlayeredT&printT">Print</a>'
  1. On the form used for the record (e.g., an Item form), create a new custom field.

  2. Configure this custom field as an Inline HTML field. In the 'Validation & Defaulting' subtab, enter the following JavaScript code into the 'Default Value' field:

'<script language"Javascript1.2"> if(window.location.href.indexOf("printT")>0){ window.print(); } </script>'
  1. Save the custom field and the form.The JavaScript code within the Inline HTML field references the custom URL parameter (printT) defined in the saved search. When a user clicks the 'Print' link from the saved search, the record form loads with this parameter in the URL. The script, which executes on the form page, detects the printT parameter and triggers the browser's window.print() method, opening the print dialogue. While printT has historically been used for printer-friendly rendering, its status as a NetSuite reserved parameter is not explicitly confirmed in current documentation. Modern NetSuite printing often leverages Advanced PDF/HTML Templates for more robust and customizable print outputs. Additionally, users should be aware that Inline HTML fields on standard forms are slated for deprecation in a future release, which may impact the long-term viability of this specific implementation.

Expert NetSuite Support

Need help with this NetSuite issue?

Saved Searches & Formulas consulting and configuration support

Talk to a consultant