karlenigma
04/25/2018, 4:00 PMvar searchResults = search.create({
type: "salesorder",
filters: [["name","anyof",custIntID], "AND", ["item","anyof",itemIntID], "AND", ["type","anyof","SalesOrd"], "AND", ["closed","is","F"]],
columns: [search.createColumn({name: "trandate", sort: search.Sort.DESC}), "rate"]}).run().getRange({start:0, end: 1});
jkabot
04/25/2018, 9:20 PMcustIntID
and/or itemIntID
are likely numbers instead of strings.
In my experience search filter expressions only play nice with strings. It works in the client because in the client search.create
is implemented differently. It delegates the search to a script handler endpoint via an http request. The http request probably converts all parameters to strings.eminero
04/26/2018, 3:33 AMkarlenigma
04/26/2018, 7:17 AM{"type":"error.SuiteScriptError","name":"SSS_INVALID_SRCH_OPERATOR","message":"An nlobjSearchFilter contains an invalid operator, or is not in proper syntax: item."
karlenigma
04/26/2018, 7:40 AMjkabot
04/26/2018, 3:51 PMtypeof itemIntId
jkabot
04/26/2018, 3:51 PMjkabot
04/26/2018, 3:52 PMString(itemIntId)
karlenigma
04/26/2018, 3:54 PM