<@UAY2A4UBA> <@U7A0KGURX> If you don't like mutati...
# suitescript
a
@reptar @alien4u If you don't like mutation and enjoy purely functional programming you can use this for dynamic filters. In this example it is passing an array of accountIds and creating the filters for it. It is good for the searches where
anyof
doesn't work.
Copy code
function filterQueryBuilder(accountIds) {
            return accountIds.map(function (accountId, i) {
                return [["entityid", "is", accountId]].concat(i !== accountIds.length - 1 ? ["OR"] : [])
            }).reduce(function (pre, cur) {
                return pre = pre.concat(cur)
            })
        }