How to highlight NetSuite saved search rows with a formula

Use a Formula (Numeric) Highlight if... condition to compare two fields on the same row, such as invoices where Amount Remaining is more than half of Amount.

The quick answer

On the saved search's Highlighting subtab, click the icon next to Condition on Highlight if... and choose Formula (Numeric) as the filter. Enter a formula that returns 1 when the row should stand out and 0 when it shouldn't, for example . Set the operator to equal to with a Value of 1, pick a color, click Add, and save the search. A plain highlight condition compares one field with a fixed value. A formula can compare two fields on the same row.

The screenshots show sample data. Person and operating-company names are fictional. Use your own search and values when following the steps.

Before you start

This walkthrough starts from an existing saved search that you can edit, as its owner or through a role that lets you edit it. In this example it's a Transaction saved search called Open Invoice Balances. Its criteria are Type is Invoice, Main Line is true, and Amount Remaining is greater than 0. Its results show Document Number, Name, Amount, Amount Remaining, and Due Date/Receive By, sorted by due date.

The goal is to make invoices with more than half of the total still unpaid stand out. A plain Highlight if... condition can't express that. It compares one field with a fixed value, like Days Overdue greater than 30, and here the threshold is different for every invoice. If a fixed value is all you need, highlight overdue invoices with a single-field condition instead.

Main Line is true keeps the invoice's main row, which gives one row per invoice as long as the search doesn't add a join that repeats it. Amount and Amount Remaining are then invoice totals rather than line amounts. Without it, the search returns a row per line and the formula compares the wrong numbers.

Amount Remaining greater than 0 is a practical stand-in for "open". If your definition of open has to exclude other statuses, add a Status criterion too.

01. Preview the search before highlighting

Open Open Invoice Balances from Reports > Saved Searches in edit mode. The Criteria subtab shows the three filters that return one row per open invoice.

The criteria return one row per open invoice: Type is Invoice, Main Line is true, and Amount Remaining is greater than 0.

Click Preview so you have a before picture. The results show Total: 6, with each invoice's Amount beside its Amount Remaining. INV-4108 has all 8,400.00 unpaid, INV-4112 has 3,000.00 of 6,000.00, and INV-4127 has 1,200.00 of 4,800.00. Every row looks the same.

Before highlighting: six open invoices, each with its Amount and Amount Remaining, all formatted the same.

02. Choose Formula (Numeric) as the filter

Click Return To Criteria and open the Highlighting subtab. Stay on Highlight if.... The Highlight if... (Summary) subtab is for searches whose result columns use summary types like Group or Sum, and this one doesn't.

Click the icon next to the Condition field. The Saved Transaction Search popup opens with the same Filter list you use for criteria. Open the list and choose Formula (Numeric), not a single field.

Choose Formula (Numeric) from the Filter list. Formula (Date) sits right above it.

Pick the formula type that matches what the expression returns. This one returns 1 or 0, so it's Formula (Numeric). Use Formula (Date) for an expression that returns a date and Formula (Text) for one that returns text.

A second popup, Transaction Search, opens on top. It has Function, Field, and Formula, then a Formula (Numeric) operator with Value.

03. Write the formula and set it to 1

Click in Formula and type CASE WHEN with a space at the end. Then open Field, type amount rem in Filter by Name or ID, and choose Amount Remaining. Two other fields start with the same words, so check you've got the plain one.

Filter the Field list by amount rem and choose Amount Remaining, not the foreign-currency version.

NetSuite adds {amountremaining} to the end of the formula, and Field goes blank again. In the account shown here it adds the ID at the end even when the cursor is somewhere else in the text, so read the whole formula after each insert. If an ID lands in the wrong place, move it or type it yourself. {amount} works the same way through Field if you'd rather pick it than type it.

After choosing the field, Formula reads CASE WHEN {amountremaining} and the Field box is empty again.

Type the rest after it: > {amount} / 2 THEN 1 ELSE 0 END. The full formula is:

CASE WHEN {amountremaining} > {amount} / 2 THEN 1 ELSE 0 END

It returns 1 when more than half of the invoice is unpaid and 0 otherwise. In the Formula (Numeric) operator, choose equal to and enter 1 in Value.

The finished formula, with the operator set to equal to and Value 1.

Click Set. Back in Saved Transaction Search, the filter row reads Formula (Numeric), is 1, and the formula. Click Set there too. The Condition field now reads Formula (Numeric) is 1.

The first popup shows the finished filter. Click Set to send it to the Condition field.

A typo or a wrong field ID usually makes the search fail with an invalid-expression error when you preview it. Blank values fail quietly, so a row can miss the highlight without any error. If the results look off, add the same formula as a Formula (Numeric) column on the Results subtab and check which rows show 1 and which show 0.

04. Add a background color

In Background Color on the same rule line, type #FFE08A, a light yellow. If your color control only offers a palette, pick a light yellow there instead.

The rule line has the condition, Formula (Numeric) is 1, and #FFE08A in Background Color.

Click Add. The rule shows its condition and a yellow chip under Background Color.

After Add, the rule is in the sublist with its yellow chip.

05. Preview the highlighted results

Click Preview. The total is still 6. INV-4108 (8,400.00 of 8,400.00 unpaid), INV-4115 (6,750.00 of 9,000.00), and INV-4123 (1,800.00 of 2,400.00) have the yellow background across the whole row.

All six open invoices are still listed. The three with more than half of the amount unpaid are yellow.

Check the result

  1. The total matches the preview from step 01. Here it's Total: 6 both times.
  2. Every yellow row has Amount Remaining above half of Amount.
  3. INV-4119 (1,300.00 of 5,200.00) and INV-4127 (1,200.00 of 4,800.00) are mostly paid and stay plain.

INV-4112 stays plain too, and that one is on purpose. Its 3,000.00 remaining is exactly half of 6,000.00, and the formula uses >, so exactly half doesn't count.

INV-4112 has 3,000.00 of 6,000.00 remaining, exactly half, so it isn't highlighted.

If "at least half" is your rule, change > to >=. {amountremaining} * 2 > {amount} gives the same result as the division if you'd rather avoid it.

Preview doesn't save anything. Click Save on the search, or the highlighting is gone next time you open it.

Highlighting is for results on screen. It never adds or removes a row, and the colors don't carry into CSV or Excel exports or scheduled emails.

Common questions

Why use a formula instead of a normal highlight condition?

A normal Highlight if... condition compares one field with a fixed value, like Amount Remaining greater than 1,000. A formula can compare two fields on the same row, so each invoice is judged against its own Amount.

What does Formula (Numeric) is 1 mean?

It means the formula has to return 1 for the row to be highlighted. The CASE WHEN expression returns 1 when the rule is true and 0 when it isn't, and the condition checks for 1.

Why isn't an invoice with exactly half unpaid highlighted?

Because the formula uses >, strictly greater than. INV-4112 has 3,000.00 left on 6,000.00, exactly half, so the formula returns 0. Use >= if exactly half should count.

Does highlighting change the number of results?

No. The criteria decide which invoices come back, and highlighting only changes how matching rows look. The total is 6 before the rule and 6 after it, with three rows yellow.

Why does my formula error out or highlight nothing?

A typo or a wrong field ID usually gives an invalid-expression error. Check that the formula type matches what the expression returns, Formula (Numeric) for a 1 or 0, and that each field ID landed where you meant it, since Field adds it at the end. If nothing is highlighted, add the formula as a Formula (Numeric) results column and look at which rows return 1.

What about invoices in foreign currencies?

Compare values in the same currency basis. {amount} and {amountremaining} are both base currency. If you want transaction currency, use Amount (Foreign Currency) and Amount Remaining (Foreign Currency) together. Don't mix one of each.