Hi Guys, I am passing array in filters but getting...
# suitescript
a
Hi Guys, I am passing array in filters but getting "Filter expecting numeric value was removed, as non-numeric value" error? Below is the code, var customerInternalIds = []; var customerId = getSearchResult[i].getValue({name:'internalid'}); customerInternalIds.push(customerId); filters.push(search.createFilter({ name: 'name', operator: search.Operator.ANYOF, values: customerInternalIds })); Can someone help me on this? Thanks!
b
sadly suitescript 1 has the best documentation on this
go lookup the section named
Copy code
SuiteScript 1.0 Supported Search Operators,
Summary Types, and Date Filters
e
That error is very unhelpful, but just looking at the code,
name
is a text field, so the
ANYOF
operator isn't going to be valid. The valid operators by field type are here
a
@battk/ @erictgrubaugh so which operator should I use? BTW, this code is working on Sandbox but not working on Production, not sure why
b
not really enough code was shared
but there are really only 2 places you could get this wrong
first is that name isnt a select or multi select type field, in which case the any of operator is invalid
or that it is a select and your code messed up with the customerInternalIds
one of them isnt an internal id
a
Okay @battk, thanks!, will check it