Portlet.addField(options)
Method Description |
Adds a field to the form. |
Returns |
|
Entry Point |
|
Since |
2016.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
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 |
2016.2 |
|
string |
required |
The label for this field. |
2016.2 |
|
string |
required |
The field type for the field. For more information about possible values, see serverWidget.FieldType. |
2016.2 |
|
string |
optional |
The internal ID or script ID of the source list for this field if it is a select (List/Record) or multi-select field.
Note:
For radio fields only, the source parameter must contain the internal ID for the field.
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. |
2016.2 |
Syntax
The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see SuiteScript 2.x Portlet Script Type.
...
var newField = params.portlet.addField({ id: 'textfield', type: serverWidget.FieldType.TEXT, label: 'text'
});
...