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
A
suitescript api
1objComponent.createColumn({2 fieldId: /* string */,3 formula: /* string */,4 type: /* string */,5 groupBy: /* boolean, optional */,6 label: /* string, optional */,7 context: /* Object, optional */8});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.fieldId | string | The 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.formula | string | The 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.type | string | If 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.groupBy | boolean | optional | Whether 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.label | string | optional | The 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.context | Object | optional | The field context for values in the query result column. This value sets the Column.context property. |
B
mynt syntax
No Mynt syntax yet.
Nothing in the language compiles to Component.createColumn(options) today. How should it read?
C
community proposals
Competing syntax for createColumn, from GitHub Discussions. Select two or more to compare them side by side.
Loading proposals from GitHub…
D
suggest an alternative
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,saveandRef[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?