Component object method · N/query

createCondition()

Component.createCondition(options)

Creates a condition (filter column) based on the component.

Implementation
Not started
Design
Open for proposals suggest how it should read
Proposals
A
Signature
Component.createCondition(options)
Module
N/query
Returns
query.Condition
Governance
None
Script types
Client and server scripts
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2018.1
call shapefrom Oracle's parameter table
1objComponent.createCondition({2    fieldId:   /* string */,3    operator:  /* string, required */,4    values:    /* string[] | number[] | [] | Date[] | query.RelativeDate [] | query.Period [] */,5    formula:   /* string */,6    type:      /* string */,7    aggregate: /* string, optional */8});
Oracle reference for this method
ParameterTypeRequiredDescription
options.fieldIdstringThe field that the condition applies to. This value sets the Condition.fieldId property. Obtain this value from the Records Catalog. The Records Catalog lists every record type and field that is available using SuiteAnalytics Workbook and the N/query module. For more information, see Records Catalog Overview .
options.operatorstringrequiredThe operator used by the condition. This value sets the Condition.operator parameter. Use the appropriate query.Operator enum value to pass in your argument. This enum holds all the supported values for this parameter.
options.valuesstring[] | number[] | [] | Date[] | query.RelativeDate [] | query.Period []An array of values to use for the condition. This value sets the Condition.values property.
options.formulastringThe formula used to create the condition. This value sets the Condition.formula property. For more information about formulas, see Formulas in Searches and SQL Expressions .
options.typestringIf you use the options.formula parameter, use this parameter to explicitly define the formula's return type. This value sets the Condition.type property. Use the appropriate query.ReturnType enum value to pass in your argument. This enum holds all the supported values for this parameter.
options.aggregatestringoptionalAn aggregate function to run on the condition. An aggregate function performs a calculation on the condition values and returns a single value. This value sets the Condition.aggregate property. Use the appropriate query.Aggregate enum value to pass in your argument. This enum holds all the supported values for this parameter.
B

No Mynt syntax yet.

Nothing in the language compiles to Component.createCondition(options) today. How should it read?

C

Competing syntax for createCondition, from GitHub Discussions. Select two or more to compare them side by side.

All discussions

Loading proposals from GitHub…

D

Write the Mynt you wish you could write.

A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.

  • Clarity. Does it say what happens, without ceremony?
  • Consistency. Does it read like load, save and Ref[field]?
  • Expressiveness. Does it cover the cases people actually write?
  • Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?

N/query · Component.createCondition(options)

Suggest syntax for createCondition