Sublist object method · N/ui/serverWidget
addField()
Sublist.addField(options)
Add a field to a sublist.
- Implementation
- Not started
- Design
- Open for proposals suggest how it should read
A
suitescript api
1objSublist.addField({2 id: /* string, required */,3 label: /* string, required */,4 type: /* string, required */,5 source: /* string, optional */,6 container: /* string, optional */7});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.id | string | required | The internal ID for this field. The internal ID must be in lowercase and without spaces. |
| options.label | string | required | The UI label for this field. |
| options.type | string | required | The field type. Use the serverWidget.FieldType enum to set this value. The DATETIME, FILE, HELP, INLINEHTML, LABEL, LONGTEXT, MULTISELECT, RADIO and RICHTEXT values are not supported with this method. Note: If you have set the type parameter to SELECT , and you want to add custom options to the select field, you must set source to NULL. |
| options.source | string | optional | The internalId or scriptId of the source list for this field. Use this parameter if you are adding a select (List/Record) type of field. Note: If you want to add custom options on a select field, you must set the source parameter to NULL. Important: After you create a select or multi-select field that is sourced from a record or list, you cannot add additional values with Field.addSelectOption(options) . The select values are determined by the source record or list. |
| options.container | string | optional | The internal ID of the tab or field group to add the field to. Use this parameter to specify either a tab or a field group to place the field in. By default, the field is added to the main section of the form. |
B
mynt syntax
No Mynt syntax yet.
Nothing in the language compiles to Sublist.addField(options) today. How should it read?
C
community proposals
Competing syntax for addField, 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?