RE: What is the correct syntax for creating a Search that uses the Search Operator ANYOF

When creating a Search with the following filters,

var invoiceSearch = searchModule.create({
     type: “invoice”,
         [“number”, searchModule.Operator.ANYOF, invoiceNumbers]
         searchModule.createColumn({name:"tranid", label: "Document Number"}),
         searchModule.createColumn({name:"createdfrom", label: "Created From"})

Where invoiceNumbers is [“123″,”124″,”125”]

But I get an error,

{“type”:”error.SuiteScriptError”,”name”:”SSS_SEARCH_FOR_EACH_LIMIT_EXCEEDED”,”message”:”No more than 4000 search results may be returned at one time from nlobjSearchResultSet.forEachResult(callback)…}

I was expecting 3 results not 4000+, Am I structuring my filter correctly?

nathanw Beginner Asked on September 30, 2019 in SuiteScript.
Add Comment
3 Answers

Use filter expression for multiple freeform text values ex.

var s = search.create({type:’invoice’})

var f = [

[‘tranid’, ‘is’, ‘INV1’],


[‘tranid’, ‘is’, ‘INV2’]


s.filterExpression = f

Beginner Answered on October 1, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.