Hej, what is the limitation to set values in the f...
# suitescript
x
Hej, what is the limitation to set values in the following example? I mean, what is the max length of the array? Or the max text/bit of the values? ... var mySearchFilter = search.createFilter({ name: 'salesrep', operator: search.Operator.ANYOF, values: [10, 15, 20] }); ...
n
Why are you asking? are you getting an error? there is no known limitation on this.
x
Thanks for replying. I am not getting error. Just interested to know the limitation. I donot think we can put as large as we want in the values.
n
If you are passing 100 of IDs, then what is the point of using the filter? Just get all the results and filter the results using array.filter()
x
Thanks for the tips of array.filter()! 😀
👍 1
w
I had a list of 2000 internal IDS of items that I wanted to resolve into a list of item names. Since there were a few million items in the system, searching then filtering was not an option, so I put the IDs in the values array. NS did not stop me putting them all in, but the search took a long time to run and threw a "SSS_SEARCH_TIMEOUT" error. I'd recommend limiting your values array length to under 100 and running it in batches.
👍 1
m
Use a formula filter with
CASE WHEN {internal} IN....
for much better performance
👍 1
n
@michoel How did you compare the performance?
m
Timed both searches. I can't remember the exact numbers but it was something like 10 seconds using the formula vs 2 minutes with any of
👍 2
n
I will give it a try next time I am running anyof.