Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Advanced Search Using Expressions in SuiteScript
Saved Search in NetSuite is a powerful feature. In the UI, one can build a saved search using expressions. To do this , check the “USE EXPRESSIONS” box.For example, we want to build a saved search that has the following criteria:
Criteria : (Item =ItemID1 & OrderType=OrderTypeId1 &
OrderTypeUsage=OrderTypeUsageId1) or
(Item =ItemID2 & OrderType=OrderTypeId2 &
OrderTypeUsage=OrderTypeUsageId2) or (Item =ItemID3 & OrderType=OrderTypeId3
& OrderTypeUsage=OrderTypeUsageId3) ……
The following script demonstrates how to achieve this:
var transactionDate = record.getFieldValue('trandate'); var filters = []; var fExp = []; for ( i = 0; i < data.length; i += 1) { filters.push(['custrecord_tintri_order_type_item', 'anyof', data[i].item]); filters.push('and'); //Make sure not empty if (!isEmpty(data[i].orderType)) { filters.push(['custrecord_tintri_order_type', 'anyof', data[i].orderType]); } else { filters.push(['custrecord_tintri_order_type', 'anyof', '