workbook.createTableColumn(options)
Method Description |
Creates a table column. Table columns are used in table definitions, and include an alias, dataset column alias/ID, filters, a label, sorts, and a column width. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2020.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
optional |
The alias for the table column. The alias can be used for mapping results. |
|
optional |
Additional conditions for the table column. |
|
|
required |
The conditional formatting to apply to the table column. |
|
|
string |
required |
The alias of the underlying dataset column. |
|
string | workbook.Expression |
optional |
The label for the table column. |
|
optional |
The sorting behavior for the table column. |
|
|
number |
optional |
The width of the table column in the UI, in pixels. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/workbook Module Script Samples. Also see Full scripts in the Tutorial: Creating a Workbook Using the Workbook API topic.
// Add additional code
...
// Create a basic TableColumn
var myTableColumn = workbook.createTableColumn({
datasetColumId: 1,
sort: mySort
});
// Create a TableColumn with filters
var myTableColumn = workbook.createTableColumn({
datasetColumId: 1,
filters: [myTableFilter],
sort: mySort
});
// Create a complex TableColumn
var myTableColumn = workbook.createTableColumn({
filters: [myTableFilter],
width: 50,
datasetColumnId: 7,
fieldContext: myFieldContext,
label: 'My Complex Table Column',
alias: 'myComplexTableColumn',
sort: mySort
});
...
// Add additional code