Component object method · N/query

createColumn()

Component.createColumn(options)

Creates a query result column based on the component.

Implementation
Not started
Design
Open for proposals suggest how it should read
Proposals
A
Signature
Component.createColumn(options)
Module
N/query
Returns
query.Column
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.createColumn({2    fieldId: /* string */,3    formula: /* string */,4    type:    /* string */,5    groupBy: /* boolean, optional */,6    label:   /* string, optional */,7    context: /* Object, optional */8});
Oracle reference for this method
ParameterTypeRequiredDescription
options.fieldIdstringThe field ID of the query result column. This value sets the Column.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.formulastringThe formula used to create the query result column. This value sets the Column.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 Column.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.groupBybooleanoptionalWhether the query results are grouped by this query result column. This value sets the Column.groupBy property. If you do not pass in an argument, the default value is set to false .
options.labelstringoptionalThe label for the column. A label is important if the query object is used as the data source for printing (for example, in the TemplateRenderer.addQuery(options) method in the N/render module).
options.contextObjectoptionalThe field context for values in the query result column. This value sets the Column.context property.
B

No Mynt syntax yet.

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

C

Competing syntax for createColumn, 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.createColumn(options)

Suggest syntax for createColumn