1

I need to add a set of filter conditions with brackets through the createfilter method, but in suitescript 2.0 I did not find an effective method

1 Answers1

0

Use a filter expression.

Create the search in the UI, and then load the search using search.load(). You can inspect the filter expression that way.

const mySearch = search.load({id:'customsearch_mysearch'});
log.debug('expression', mySearch.filterExpression);

The filter expression is an array. You can set the filters when you create the search.

Something like;

search.create({
    type: 'customer',
    filters: myFilterArray,
                columns: [
                    search.createColumn({name: 'entityid'})
                ]
ehcanadian
  • 1,738
  • 1
  • 15
  • 23