Search code examples
netsuitesaved-searches

How to set up prefixes on saved search for multiple choices in netsuite?


I have a multiple select field that allows multiple selections of colors. I created a formula that would append a prefix of "color-" to each selected list, but it only appends it to the the beginning of the field. I'm not sure how I can split the field results up for the formula to where I can get it showing up for all results.

CASE WHEN {custitemtag_color1} is NULL THEN '' ELSE 'color-'||{custitemtag_color1} END

Results with multiple selections show: color-Black,Lime Green,White

Expected Results need to show: color-Black,color-Lime Green,color-White


Solution

  • What's happening is that NetSuite returns "Black,Lime Green,White" as a single result for the multi-selection, then you're prepending "color-" to that text returned. To work around it within your saved search, you could simply replace any instances of the comma (",") with ",color-":

    CASE WHEN {custitemtag_color1} is NULL THEN '' ELSE 'color-'|| REPLACE({custitemtag_color1}, ',', ',color-') END