In this blog post, I will showcase a common challenges faced when using saved search  – linking to the results of another saved search from within the results of saved search – and how to accomplish it

The Scenario

Consider the following scenario

  • You are required to create a saved search that shows item and it’s various associated transactions.
  • We don’t want to show the same item more than once
  • We want to enable drill through functionality that will allow a user to quickly see all of the transactions associated with that item

The Solution

  • Since we only want to show each item once, we’ll build our saved search based on the Item record
  • Update our criteria to only show Inventory Items  – we do this by selecting the Type equal to Inventory
  • Go to Results tab and show Name, Display Name, Description, Type and Base Price
  • Create a formula (text) column named “Sales Transactions”
  • Create a formula (text) column named “Purchase Transactions”
  • Create a formula (text) column named “Inventory Transactions”

The values for our formula (text) columns for Sales Transactions, Purchase Transactions and Inventory Transactions will link to separate saved searches, which will show all of the transactions related to the given item – I will demonstrate how we construct this URL a little bit later in this post

Before we get there, we need to create our “child” saved searches, which will show the transactions related to an item in our “parent’ saved search.  To do this, we’ll create a new saved search against the Transaction and set the TYPE to Invoice, Sales Orders, Cash Sale, Credit Memo (or any other transaction type you’d like to include).  At a minimum, you’ll need to set your Available Filters to the Item – in my example, I’ve also include the Location.

The saved search will look like this:

NetSuite Saved Search Filters

 To determine the structure of the URL of this child saved search, we’ll run the search and set our filters on the item and location (I’ve blocked out some of the information for privacy purposes).Child Saved Search URLThis is the URL we see:

The two elements of the URL that we should focus on are the filters that we set – these are Transaction_LOCATION and Transaction_ITEM

In our example, you’ll see that the value for Location is 2, whereas Item is 1205. Both of these are Internal IDs.  If you change these to any other existing Internal IDs manually and refresh the view, you’ll see that the results will change!  So, now you know that you can set the filters on a saved search through URL parameters.

With this new understanding, we will now use these URL based filters from the saved search formula in the our parent item saved search.

The formula (text) for Sales Transaction is shown below – we will use an HTML anchor tag, which will be used to open the saved search of the related sales transactions in a new tab.

(‘<a href=https://system.na2.netsuite.com/app/common/search/searchresults.nl?searchid=60&saverun=T&Transaction_LOCATION=ALL&Transaction_ITEM=’|| {internalid} ||’  target=”_blank”>Sales details</a>’ )

 Transaction_ITEM  is set with the INTERNALID of the itemID.
 Transaction_LOCATION is set with value ALL which shows all locations (to search for specific location, use {inventorylocation.internalid}, which is shown in below example).

(‘<a href=https://system.na2.netsuite.com/app/common/search/searchresults.nl?searchid=60&saverun=T&Transaction_LOCATION=’|| {inventorylocation.internalid}||’ &Transaction_ITEM=’|| {internalid} ||’  target=”_blank”>Sales details</a>’ )

Review Our Saved Search

Set Child Saved Search URL Text Formula

Results Tab

Saved Search Results

By clicking on the Sales Details link, you’ll see the results of the related child saved search showing all sales transactions related to the item.  This approach can be leverage and widely applied through NetSuite, well beyond just transactions related to an item.

I hope you found this to be helpful!  Thanks for visiting my blog and have a nice day. If you’re looking for a NetSuite implementation partner, please reach out to our team with any questions.

As a leading NetSuite partner, we’ve established a genuine methodology to help maximize every dollar of your ERP budget and ensure NetSuite is meeting your needs. Learn more about our NetSuite support and optimization services.

Additional NetSuite Resources

Creating a Save Search in NetSuite for Transactions with Related Records

Avoid This Common NetSuite Mistake When Building a Transaction Saved Search

Update Hidden Subsidiary Sublists in NetSuite