Is there a way to highlight duplicates values in S...
# general
b
Is there a way to highlight duplicates values in Saved Searches? For example, even after putting Main Line = true, there are still transactions w/ the same transaction type with the same Document Number and I want to put highlight those in the saved search results.
a
What kind of Record Type are you searching for? Usually when I’m getting “duplicates” it’s because my criteria or results are pointing at the same record but two separate fields.
b
I'm specifically testing for Requisition transaction types but it should apply to any transaction type. Altho auto generated numbers are enabled, I am able to override it so there is a case where there are duplicate doc numbers but still separate transactions. I know I can just export it to excel and highlight duplicates but I was hoping to do it in the saved search itself
a
Definitely check @michoel’s answer right below. I think he is correct in thinking that your duplicates are due to a joined field or maybe the result of having an ‘OR’ expression somewhere.
m
@Alex Hirota I think @blue is saying they are separate transactions but share the same document number
a
@michoel Ah, my mistake. I added my own thought process of wanting to highlight the transactions with the purpose of removing them, instead of realizing they were indeed separate transaction. Many apologies!
b
Thanks so much @michoel your formula worked. I'm just abit confused on how the formula works.. can you explain this part of the formula? "SUM/* comment */(1) OVER(PARTITION". Like what is comment and overpartition?
m
The
/* comment */
is a hack to trick NetSuite to let you use Oracle analytic functions. There's a great explanation here: https://blog.prolecto.com/2015/05/26/solving-the-netsuite-cumulative-saved-search-tally-challenge/
b
@michoel Hmm interesting. I will have a look thanks! One last question btw, can I make it that it only highlight the Document Number field in the saved search results? When I tested the formula, it highlighted the whole line. Is there a way to highlight only a specific field?
m
Instead of using the saved search highlighting, change your result column to a formula text and style using CSS
E.g. (untested!!)
CASE WHEN SUM/* comment */(1) OVER(PARTITION BY {number}, {type}) > 1 THEN '<div style="background-color: red;">' || {number} || '</div>' ELSE {number} END