USING CASE (IF AND ELSE) IN NETSUITE SAVED SEARCH- NETSUITE ACADEMY

While creating a saved search in Netsuite, you want encounter a situation where you want have to display a value depending on some conditions. Such scenarios can be implemented by using sql CASE syntax in the formula field. For eg, in a transaction search, if you want to display a value depending on the transaction type, then you can add a formula text field in coulmn and use CASE as given below:


CASE WHEN {type}='Invoice' THEN '0'
WHEN {type}='Journal' THEN {status}
 ELSE '' END

The above field will display 0 when type is Invoice. It will display status of the transaction when type is Journal and for other transaction type, it will be blank.


NETSUITE ACADEMY

Comments

Popular posts from this blog

ALERT IN NETSUITE USING USER EVENT BEFORE LOAD SCRIPT

HOW TO CREATE SUITELET ASSISTANT IN NETSUITE?

USER EVENT SCRIPT 2.0 TO LOAD A RECORD, READ IT'S VALUE AND SET A FIELD VALUE