random question, does anyone know why I would be g...
# suitescript
m
random question, does anyone know why I would be getting the error
Copy code
Error	Search filter removed	11/23/2021	9:41 pm	Scientist Admin	Filter expecting numeric value was removed, as non-numeric value 'KY' was provided
for
Copy code
taxItemSearch.filters[2] = search.createFilter({ name: 'state', operator: 'is', values: state })
on a
taxgroup
search? Is it expecting an internal id or something?
https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2021_2/script/record/taxgroup.html suggests it’s a
select
dropdown, but also says the same for
country
which I use the same 2 character string for (‘US’, ‘DE’, etc.)
all filters look like-
Copy code
taxItemSearch.filters[0] = search.createFilter({name: 'country', operator: 'is', values: country})
      taxItemSearch.filters[1] = search.createFilter({name: 'isinactive', operator: 'is', values: false})
      if (country === 'US') {
        taxItemSearch.filters[2] = search.createFilter({ name: 'state', operator: 'is', values: state })
      }
b
the usual advice applies
make the search in the ui, load the search you created and inspect its filters
do whatever it does
m
Yep, spent the last couple hours doing that finally figured it out sorry I should’ve posted here. Boy do the netsuite docs suck for this
search.createFilter({name: 'formulatext', operator: 'is', values: state, formula: '{state}'})
apparently this dropdown is somehow different than the country dropdown even though the schema browser says they’re the same facepalm
b
the spoiler is that if the error message says one thing and the record browser another
the error message wins
m
Yes, I was just trying to figure out how to not need the internalid of the state dropdown list values because that’s a ridiculous thing to know in a search