This came up yesterday. Here is my note regarding how it works.
If you create a search in SuiteScript 2.0, you can set a filter expression via the filters property.
var mySearch.create({
type: [whatever type you like],
columns: [ search.createColumn({ name: 'internalid'... }),
filters: [
['internalid', 'anyof', [more filter stuff here]]
}
This works great. It accepts the advanced filter, no problem! However, when I load an existing saved search, I cannot submit a filter expression in the same way. Here’s how that works.
var mySearch.load({
id: [an id of an existing saved search]
};
mySearch.filterExpression = [
['internalid', 'anyof' [more filter stuff here]]
];
When you load an existing search and want an advanced filter expression, you must use the filterExpression property!
nice find Kevin!
this will come in handy in the future… so much is done with saved searches 😉
thanks
LikeLike