Form object method · N/ui/serverWidget
addField()
Form.addField(options)
Adds a field to the form.
- Implementation
- Not started
- Design
- Open for proposals suggest how it should read
A
suitescript api
1objForm.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 of the field. The internal ID must be in lowercase, contain no spaces, and include the prefix custpage if you are adding the field to an existing page. For example, if you add a field that appears as Purchase Details , the field internal ID should be something similar to custpage_purchasedetails or custpage_purchase_details . |
| options.label | string | required | The label for this field. |
| options.type | string | required | The field type for the field. Use the serverWidget.FieldType enum to define the field type. Important: Long text fields created with SuiteScript have a character limit of 100,000. Long text fields created with Suitebuilder have a character limit of 1,000,000. |
| options.source | string | optional | The internalId or scriptId of the source list or record type for this field if it is a select (List/Record) or multi-select field. Source list is a category containing standard lists and custom lists. Record types include standard record types like employee, sales order, and transaction, as well as custom record types. Examples of IDs include: standard record (salesorder, customer, employee); custom record (customrecord_car_model); standard list: (employeetype, ordertype); custom list (customlist_color). 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. Note: For radio fields only, the source parameter must contain the internal ID for the field. For more information about working with radio buttons, see SuiteScript 1.0 Documentation . |
| options.container | string | optional | The internal ID of the tab or field group to add the field to. 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 Form.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?