Does anyone know why when creating search filters ...
# suitescript
t
Does anyone know why when creating search filters in SuiteScript 2.0, some fields work with search.Operator.IS while others only work with search.Operator.EQUALTO? I had a weird issue where I was trying to filter transactions by a specific value in a text field using search.Operator.IS but the filter was essentially being ignored until I switched to search.Operator.EQUALTO
s
there is a page in NS help that describes what operators work with each field type. @battk is the help link superhero so he may chime in but otherwise do a search in NS help.
👍 1
t
I did find a NetSuite help article titled SuiteScript 1.0 Search Operators that show a table of what fields each operator works on, and it seems to show that both IS and EQUALTO should both work on free-form text fields. Granted, this is showing SuiteScript 1.0 but I assume 2.0 would hold the same principles
b
that is the documented table, though i must say that i dont use it
the basic approach for searches should be to make the search in the ui first, then copy it in code
✔️ 1
s
Yep, always start with a UI created saved search if possible. Alternatively, if you are finding the syntax or limitations of the search framework frustrating, you can always give the N/query module and SuiteQL a try, which uses a syntax closer to actual SQL.