Hi, hope you are doing well and thank you for your...
# suitescript
s
Hi, hope you are doing well and thank you for your time. I am trying to create a Vendor saved search in NetSuite. Named: Vendor Record Change History Each row needs to display a separate Vendor along with what was the old value and what was the new value for some specific fields For example: The columns I need to add and group/display in one row are: VENDOR, NAME - UPDATED ON (Date), NAME - OLD VALUE (Text), NAME - NEW VALUE (Text), TRADE LICENSE - UPDATED ON (Date), TRADE LICENSE - OLD VALUE (Text), TRADE LICENSE - NEW VALUE (Text) But currently I am facing challenges while grouping these values in one row against a single vendor. Currently the values against these columns are distributed in multiple rows (I have tried using formula columns but that didn't gave me desired result). Any thoughts on this? Is this achievable by using standard saved search (with formulas)? Or do I need to move to a custom solution which uses SuiteScript?
a
so its FAR from ideal but you can get the dates with a simple MAX summary and CASE formula replace with your required field name
Copy code
CASE    WHEN {systemnotes.field} = 'Name/ID' THEN {systemnotes.date}   ELSE NULL END
Then you can use the date and max again in another formula field and concat the old and new values into a single column result - again change the text for the field you need
Copy code
CASE  WHEN {systemnotes.field} = 'Name/ID'  THEN TO_CHAR({systemnotes.date}, 'YYYYMMDDHH24MISS')       || '|'       || NVL({systemnotes.oldvalue}, '-None-')       || '|'       || NVL({systemnotes.newvalue}, '-None-')END