query.Operator
JavaScript does not include an enumeration type. The SuiteScript 2.x documentation uses the term enumeration (or enum) to describe a plain JavaScript object with a flat, map-like structure. In this object, each key points to a read-only string value.
Enum Description |
Holds the string values for operators supported in SuiteScript Analytic APIs. SuiteScript Analytic APIs help you work with analytical data in NetSuite using SuiteScript. For more information, see SuiteScript 2.x Analytic APIs. This enum is used to specify the operator argument to Query.createCondition(options) and Component.createCondition(options). This enum is also used to specify the operator argument to methods in the N/dataset and N/workbook modules, such as dataset.createCondition(options) and workbook.createTableColumnFilter(options). For more information, see Workbook API. Values for this enum are listed in the Values section. The following columns provide information about each operator:
For multi-select fields, you can use the |
Module |
|
Sibling Module Members |
|
Since |
2018.1 |
Values
Value |
Mapped String Value |
Use For |
---|---|---|
|
AFTER |
Date/time values |
|
AFTER_NOT |
Date/time values |
|
ANY_OF |
Single-select fields Multi-select fields |
|
ANY_OF_NOT |
Single-select fields Multi-select fields |
|
BEFORE |
Date/time values |
|
BEFORE_NOT |
Date/time values |
|
BETWEEN |
Numbers |
|
BETWEEN_NOT |
Numbers |
|
CONTAIN |
Strings |
|
CONTAIN_NOT |
Strings |
|
EMPTY |
Single-select fields Multi-select fields |
|
EMPTY_NOT |
Single-select fields Multi-select fields |
|
ENDWITH |
Strings |
|
ENDWITH_NOT |
Strings |
|
EQUAL |
Numbers |
|
EQUAL_NOT |
Numbers |
|
MN_EXCLUDE |
Multi-select fields |
|
MN_EXCLUDE_ALL |
Multi-select fields |
|
MN_EXCLUDE_EXACTLY |
Multi-select fields |
|
GREATER |
Numbers |
|
GREATER_NOT |
Numbers |
|
GREATER_OR_EQUAL |
Numbers |
|
GREATER_OR_EQUAL_NOT |
Numbers |
|
MN_INCLUDE_ALL |
Multi-select fields |
|
MN_INCLUDE |
Multi-select fields |
|
MN_INCLUDE_EXACTLY |
Multi-select fields |
|
IS |
values |
|
IS_NOT |
values |
|
LESS |
Numbers |
|
LESS_NOT |
Numbers |
|
LESS_OR_EQUAL |
Numbers |
|
LESS_OR_EQUAL_NOT |
Numbers |
|
ON |
Date/time values |
|
ON_NOT |
Date/time values |
|
ON_OR_AFTER |
Date/time values |
|
ON_OR_AFTER_NOT |
Date/time values |
|
ON_OR_BEFORE |
Date/time values |
|
ON_OR_BEFORE_NOT |
Date/time values |
|
START_WITH |
Strings |
|
START_WITH_NOT |
Strings |
|
WITHIN |
Date/time values |
|
WITHIN_NOT |
Date/time values |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.
// Add additional code
...
var myCustomerQuery = query.create({
type: query.Type.CUSTOMER
});
var mySalesRepJoin = myCustomerQuery.autoJoin({
fieldId: 'salesrep'
});
var firstCondition = myCustomerQuery.createCondition({
fieldId: 'id',
operator: query.Operator.EQUAL,
values: 107
});
var secondCondition = myCustomerQuery.createCondition({
fieldId: 'id',
operator: query.Operator.EQUAL,
values: 2647
});
var thirdCondition = mySalesRepJoin.createCondition({
fieldId: 'email',
operator: query.Operator.START_WITH_NOT,
values: 'foo'
});
myCustomerQuery.condition = myCustomerQuery.and(thirdCondition, myCustomerQuery.not( myCustomerQuery.or(firstCondition, secondCondition)));
var resultSet = myCustomerQuery.run();
...
// Add additional code