Search.filterExpression
Property Description |
Use filter expressions as a shortcut to create filters (search.Filter). A search filter expression is a JavaScript string array of zero or more elements. Each element is one of the following:
This property accepts nested arrays in which any element of the nested array can be an Object, a string, a number, or a boolean. Use
Note:
If you want to get or set search filters, use the Search.filters property. |
Type |
Array[] |
Module |
|
Since |
2015.2 |
A filter expression is an array of filter elements defined with the options.filters
parameter when creating a search using the search.create(options) method. This property is considered a shorthand way of defining filters, instead of using the search.createFilter(options) method.
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
Malformed search filter expression. This is a general error raised when a filter expression cannot be parsed. For example:
|
The |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/search Module Script Samples.
In the script sample below, each array of objects is considered to be a search filter expression. Filter expressions are automatically recognized and defined with the options.filters
parameter.
//Add additional code
...
search.create({
type: search.Type.CUSTOMER,
filters: [
['email', search.Operator.STARTSWITH, 'kwolff'],
'and',
[
['id', search.Operator.EQUALTO, 107], 'or',
['id', search.Operator.EQUALTO, 2508]
]
]
});
...
//Add additional code