I just observed the strangest behavior with search...
# suitescript
j
I just observed the strangest behavior with search filters in SS2.0, and I after fiddling around I can't reproduce it. I usually make my searches using filter expressions like so
Copy code
search.create({
	type: search.Type.DEPOSIT_APPLICATION,
	filters: [
		['mainline', 'is', 'T'],
		'and',
		['appliedtotransaction', 'anyof', depositIds] // depositIds is array of strings, like ['1234', '5678']
	]
}).run().each(function(result) { // ...
However when I did this it ran it as if there was no appliedtotransaction filter. I ran it in the script debugger and the execution log showed a NetSuite generated log
Search filter removed
Filter expecting numeric value was removed as non-numeric value '[Ljava.lang.Object;@608e74ef' was provided
By all appearances, NetSuite edited my search before running it. I changed the filter to
Copy code
['appliedtotransaction', 'anyof'].concat(depositIds)
and it worked as expected. Then I changed it back to the first filter and it doesn't reproduce. 🤔 😟 Anyone seen anything like this before?
@shea When you saw this did you have to modify your code in some way or did it just mysteriously stop happening?
s
I think I saw someone else mentioning NS silently changing the search behind the scenes. Absurd! but maybe they'll call it a feature - artificial intelligence helping your search
🤢 1
s
@jkabot in my case it was reproducible because i was providing the wrong data. i don't, unfortunately, recall the specific scenario otherwise i'd dig it up.