Highlight a Column in NetSuite Saved Search

Once you show your teams how they can highlight rows in a NetSuite Saved Search the next thing they are going to ask is how they can highlight cells. Unfortunately, the answer within closest reach is ‘that’s not possible’. The highlighting of rows is a standard feature of the Saved Search that doesn’t require any formulas or coding. If you aren’t familiar with how to highlight a row you can learn all about it here.

Highlighting cells is not a standard feature however. It is beyond the limitations presented to you in NetSuite’s user interface for generating Saved Searches. As I am sure you are beginning to figure out though, that doesn’t make it impossible. Using a small amount of HTML you have a few options for how you can highlight columns and even individual cells.

Highlighting a Saved Search Column with HTML

We will start by highlighting an entire column to make it stand out amongst the rest of the data. Below I have a very simple search that is showing me journal lines and their values.

Example of a saved search that doesn't use any highlighting.

This is not a particularly busy search, but we will highlight the Amount column as this is where we want the viewers eye to be drawn to. We will edit the search and add a Formula (Text) column in place of our Amount column. I will give the Custom Label ‘Amount’ and then enter the following formula –

'<div style="color:black;font-weight:bold;background-color:orange">'||{amount} ||'</div>'

This formula is stating that the text should be black in color and bold against an orange background. I have used the field ID for Amount so that is the data we will be displaying.

As you can see this now gives us a much more colorful output.

A saved search with basic column highlighting.

Highlighting a Saved Search Cell with HTML

What if we want to only highlight cells where the Amount is over 100,000 though? We can use the HTML above in conjunction with a SQL CASE WHEN statement.

To highlight individual cells over 100,000 we are going to use the above HTML as the result of our CASE statement.

CASE WHEN {amount} > 100000 THEN '<div style="color:black;font-weight:bold;background-color:orange">'||{amount} ||'</div>' ELSE '<div style="color:black;font-weight:bold">'||{amount} ||'</div>' END

Here we are asking for all values over 100,000 to be displayed in black text, bold and on an orange background and for all other values to lose the orange background. This is no different to any other CASE WHEN statement except we are embedding some simple HTML within the output specification. Remember, using this type of formula you could have any number of different colored results. For example, different colors for a variety of value brackets so we can clearly see the low, medium and high value Journal entries at a glance.

The result for the above formula looks like this –

A saved search with conditional highlighting on a column.

We can also use this type of highlighting together with the standard Saved Search row highlighting. The HTML specifications will take priority, but it gives you the ability to have multiple indicators on the same row.

Mixing column highlights with standard highlighting in a NetSuite saved search.

Limitations of Highlighting with HTML

The only downside to this trick is that the html does not export to Excel. If you are creating this search for a finance team, for example, who regularly export the data rather than view it in NetSuite, this may not be the best approach. The column will export as the raw HTML and will not be usable without tidying it up.

Other than that slight negative this tip is a great way to brighten up your searches and highlight even more specific pieces of data rather than entire rows. It is perfect for data sets that are only ever going to be viewed in NetSuite and will hopefully please those users, that every company has, who are never happy with the look of a standard search.

There are lots more articles on NetFreak looking at advanced features of NetSuite’s Saved Search. Be sure to search the content here and if you can’t find what you are looking for, please get in touch.

Trying to get Management interested in NetSuite data? Have you tried KPIs?

NetSuite’s KPI Scorecards

Creating a Custom KPI in NetSuite

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *