N/ui/serverWidget Module
Use the N/ui/serverWidget module to work with the user interface within NetSuite. You can use Suitelets to build custom pages and wizards that have a NetSuite look-and-feel. You can also create various components of the NetSuite UI (for example, forms, fields, sublists, tabs).
SuiteScript does not support direct access to the NetSuite UI through the Document Object Model (DOM). The NetSuite UI should only be accessed using SuiteScript APIs.
When you add a UI object to an existing NetSuite page, to minimize the occurrence of field/object name conflicts, the internal ID that references the object must be prefixed with custpage
.
In This Help Topic
N/ui/serverWidget Module Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Suitelets |
A scriptable, multi-step NetSuite assistant. |
|
Object |
Suitelets |
A step within a custom NetSuite assistant. |
||
Object |
Suitelets and beforeLoad user events |
A button that appears in a UI object. |
||
Object |
Suitelets and beforeLoad user events |
A NetSuite field. |
||
Object |
Suitelets and beforeLoad user events |
A field group. |
||
Object |
Suitelets and beforeLoad user events |
A NetSuite form. |
||
Object |
Suitelets |
A list. |
||
Object |
Suitelets |
A list column. |
||
Object |
Suitelets and beforeLoad user events |
A NetSuite sublist. |
||
Object |
Suitelets and beforeLoad user events |
A NetSuite tab and subtabs. |
||
Method |
Suitelets |
Creates and returns a new assistant object. |
||
Suitelets |
Creates and returns a new form object. |
|||
Suitelets |
Creates a List object (specifying the title, and whether to hide the navigation bar). |
|||
Enum |
string (read-only) |
Suitelets |
Holds the string values for submit actions performed by the user. |
|
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for supported field break types. This enum is used to set the value of the Field.updateBreakType(options) property. |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for supported field display types. This enum is used to set the value of the Field.updateDisplayType(options) property. |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for the supported types of field layouts. This enum is used to set the value of the Field.updateLayoutType(options) property. |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the values for supported field types. This enum is used to set the value of the Field.type property. |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for supported page link types on a form. This enum is used to set the value of the |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for supported justification layouts. This enum is used to set the value of the align parameter when List.addColumn(options) is called. |
||
string (read-only) |
Suitelets |
Holds the string values for supported list styles. This enum is used to set the value of the List.style property. |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for supported sublist display types. This enum is used to set the value of the Sublist.displayType property. |
||
string (read-only) |
Suitelets and beforeLoad user events |
Holds the string values for valid sublist types. This enum is used to define the |
Assistant Object Members
The following members are called on the serverWidget.Assistant object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
Suitelets |
Adds a field to an assistant. |
||
Suitelets |
Adds a field group to an assistant. |
|||
Suitelets |
Adds a step to an assistant. |
|||
Suitelets |
Adds a sublist to an assistant. |
|||
Suitelets |
Gets a field object. |
|||
Suitelets |
Gets a field group object. |
|||
string[] |
Suitelets |
Gets all the field group IDs in an assistant. |
||
string[] |
Suitelets |
Gets all the field IDs in an assistant. |
||
string[] |
Suitelets |
Gets all field IDs in the assistant field group. |
||
string |
Suitelets |
Gets the last action submitted by the user. |
||
Suitelets |
Gets the step that the last submitted action came from. |
|||
Suitelets |
Gets the next step prompted by the assistant. |
|||
Suitelets |
Returns a step in an assistant. |
|||
number |
Suitelets |
Gets the total count of steps in the assistant. |
||
Suitelets |
Gets all the steps in the assistant. |
|||
Suitelets |
Get a Sublist object from its ID. |
|||
string[] |
Suitelets |
Gets all the sublist IDs in an assistant. |
||
Boolean |
Suitelets |
Indicates whether the assistant has an error message to display. |
||
Boolean |
Suitelets |
Indicates the status of the assistant. If set to true, the assistant is finished. |
||
void |
Suitelets |
Manages redirects in an assistant. |
||
void |
Suitelets |
Define a splash message. |
||
void |
Suitelets |
Sets the default values of an array of fields that are specific to the assistant. |
||
Property |
number |
Suitelets |
The File Cabinet ID of client script file to be used in this assistant. |
|
string |
Suitelets |
The relative path to the client script file to be used in this assistant. |
||
serverWidget.AssistantStep (read-only) |
Suitelets |
The current step. |
||
string |
Suitelets |
The error message text. |
||
string |
Suitelets |
The text displayed after an assistant is finished. |
||
Boolean |
Suitelets |
Whether the Add to Shortcuts Link is displayed in the UI. |
||
Boolean |
Suitelets |
Whether the current and total step numbers are displayed in the UI. |
||
Boolean |
Suitelets |
Whether assistant steps are ordered or unordered. |
||
string |
Suitelets |
The title of the assistant. |
AssistantStep Object Members
The following members are called on the serverWidget.AssistantStep object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
string[] |
Suitelets |
Gets all the field IDs in an assistant step. |
|
number |
Suitelets |
Gets the number of lines previously entered by a user in a step. |
||
string[] |
Suitelets |
Gets all the field IDs in a list. |
||
string |
Suitelets |
Gets the current value of a sublist field (line item) in a step. |
||
string[] |
Suitelets |
Gets the IDs for all the sublist fields (line items) in a step. |
||
string | string[] |
Suitelets |
Gets the current value of a field. |
||
Property |
string |
Suitelets |
The help text for a step. |
|
string (read-only) |
Suitelets |
The internal ID of the step. |
||
string |
Suitelets |
The label for a step. |
||
number |
Suitelets |
Indicates where this step appears sequentially in an assistant. |
Button Object Members
The following members are called on the serverWidget.Button object.
Member Type |
Name |
Property Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
Boolean |
Suitelets and beforeLoad user events |
Whether a button is grayed-out and disabled. |
|
Boolean |
Suitelets and beforeLoad user events |
Whether the button is hidden in the UI. |
||
string |
Suitelets and beforeLoad user events |
The label for the button. |
Field Object Members
The following members are called on the serverWidget.Field object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
void |
Suitelets and beforeLoad user events |
Adds a select option to a dropdown list for a selectable field. |
|
Object[] |
Suitelets and beforeLoad user events |
Returns the internal ID and label of the options for a select field as name/value pairs. |
||
Suitelets and beforeLoad user events |
Sets the help text that appears in the field help popup. |
|||
Suitelets and beforeLoad user events |
Updates the break type used to add a break in flow layout for the field. |
|||
Suitelets and beforeLoad user events |
Updates the height and width for the field. |
|||
Suitelets and beforeLoad user events |
Updates the type of display for the field. |
|||
Suitelets and beforeLoad user events |
Updates the layout type for the field. |
|||
Property |
string |
Suitelets and beforeLoad user events |
The alias used to set the field value. |
|
string |
Suitelets and beforeLoad user events |
The default value for the field. |
||
string (read-only) |
Suitelets and beforeLoad user events |
The help text for the field. |
||
string (read-only) |
Suitelets and beforeLoad user events |
The internal ID for the field. |
||
Boolean |
Suitelets and beforeLoad user events |
Whether the field is required. |
||
string |
Suitelets and beforeLoad user events |
The label for the field. |
||
string |
Suitelets and beforeLoad user events |
The text displayed for a link in place of the URL. |
||
number |
Suitelets and beforeLoad user events |
The maximum length, in characters, for the field. |
||
number |
Suitelets and beforeLoad user events |
The number of empty vertical character spaces above the field. |
||
number |
Suitelets and beforeLoad user events |
The height of a rich text field, in pixels. |
||
number |
Suitelets and beforeLoad user events |
The width of a rich text field, in pixels. |
||
string (read-only) |
Suitelets and beforeLoad user events |
The type of field. |
FieldGroup Object Members
The following members are called on the serverWidget.FieldGroup object.
Member Type |
Name |
Property Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
Boolean |
Suitelets and beforeLoad user events |
Whether a border appears around the field group. |
|
Boolean |
Suitelets and beforeLoad user events |
Whether the field group is collapsible. |
||
Boolean |
Suitelets and beforeLoad user events |
Whether the field group is initially collapsed or expanded in the default view. |
||
Boolean |
Suitelets and beforeLoad user events |
Whether the field group is displayed in a single column. |
||
string |
Suitelets and beforeLoad user events |
The label for the field group. |
Form Object Members
The following members are called on the serverWidget.Form object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
Suitelets and beforeLoad user events |
Adds a button to the form. |
||
Suitelets and beforeLoad user events |
Adds a field that store credentials in NetSuite for invoking services provided by third parties. |
|||
Suitelets and beforeLoad user events |
Adds a field to the form. |
|||
Suitelets and beforeLoad user events |
Adds a group of fields to the form. |
|||
void |
Suitelets and beforeLoad user events |
Shows a message on a form in view mode. You can use this method to show a message on a form based on its user event script context. |
||
void |
Suitelets and beforeLoad user events |
Adds a link to a form. |
||
Suitelets and beforeLoad user events |
Adds a Reset button to a form that clears the values of all fields. |
|||
Suitelets and beforeLoad user events |
Add a secret key field to the form. |
|||
Suitelets and beforeLoad user events |
Adds a sublist to the form. |
|||
Suitelets and beforeLoad user events |
Adds a submit button to a form that saves user inputs. |
|||
Suitelets and beforeLoad user events |
Adds a subtab to a form. |
|||
Suitelets and beforeLoad user events |
Adds a tab to a form. |
|||
Suitelets and beforeLoad user events |
Returns a button by internal ID. |
|||
Suitelets and beforeLoad user events |
Returns a field by internal ID. |
|||
Suitelets and beforeLoad user events |
Returns a sublist by internal ID. |
|||
Suitelets and beforeLoad user events |
Returns a subtab by internal ID. |
|||
Suitelets and beforeLoad user events |
Returns a tab object from its internal ID. |
|||
string[] |
Suitelets and beforeLoad user events |
Returns the internal IDs of all tabs. |
||
void |
Suitelets and beforeLoad user events |
Inserts a field before another field within a form. |
||
void |
Suitelets and beforeLoad user events |
Inserts a sublist before another sublist on a form. |
||
void |
Suitelets and beforeLoad user events |
Inserts a subtab before another subtab on a form. |
||
void |
Suitelets and beforeLoad user events |
Inserts a tab before another tab on a form. |
||
void |
Suitelets and beforeLoad user events |
Removes a button from a form. |
||
void |
Suitelets and beforeLoad user events |
Sets the default values of many fields on a form. |
||
Property |
number |
Suitelets and beforeLoad user events |
The File Cabinet ID of client script file to be used in this form. |
|
string |
Suitelets and beforeLoad user events |
The relative path to the client script file to be used in this form. |
||
string |
Suitelets and beforeLoad user events |
The title used for the form. |
List Object Members
The following members are called on the serverWidget.List object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
Suitelets |
Adds a button to a list. |
||
Suitelets |
Adds a column to a list. |
|||
Suitelets |
Adds a column containing Edit or Edit/View links to a Suitelet or Portlet list. |
|||
Suitelets |
Adds a link to a list. |
|||
Suitelets |
Adds a single row to a list. |
|||
Suitelets |
Adds multiple rows to a list. |
|||
Property |
number |
Suitelets |
The File Cabinet ID of client script file to be used in this list. |
|
string |
Suitelets |
The relative path to the client script file to be used in this list. |
||
string |
Suitelets |
The display style for this list. |
||
string |
Suitelets |
The List title. |
ListColumn Object Members
The following members are called on the serverWidget.ListColumn object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
Suitelets |
Adds a URL parameter (optionally defined per row) to the list column's URL. |
||
Suitelets |
Sets the base URL for the list column. |
|||
Property |
string |
Suitelets |
The label of this list column. |
Sublist Object Members
The following members are called on the serverWidget.Sublist object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Method |
Suitelets and beforeLoad user events |
Adds a button to a sublist. |
||
Suitelets and beforeLoad user events |
Add a field to a sublist. |
|||
Suitelets and beforeLoad user events |
Adds a Mark All or Unmark All button. |
|||
Suitelets and beforeLoad user events |
Adds a Reset button. |
|||
Suitelets and beforeLoad user events |
Returns a Field object on a specified sublist. |
|||
string |
Suitelets and beforeLoad user events |
Gets a field value on a sublist. |
||
void |
Suitelets and beforeLoad user events |
Sets the value of a sublist field. |
||
Suitelets and beforeLoad user events |
Updates the ID of a field designated as a totalling column, which is used to calculate and display a running total for the sublist. |
|||
Suitelets and beforeLoad user events |
Updates a field ID that is to have unique values across the rows in the sublist. |
|||
Property |
string |
Suitelets and beforeLoad user events |
The display style for a sublist. |
|
string |
Suitelets and beforeLoad user events |
The inline help text for a sublist. |
||
string |
Suitelets and beforeLoad user events |
The label for a sublist. |
||
number (read-only) |
Suitelets and beforeLoad user events |
The number of line items in a sublist. |
Tab Object Members
The following members are called on the serverWidget.Tab object.
Member Type |
Name |
Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
string |
Suitelets and beforeLoad user events |
The inline help text for a tab or subtab. |
|
string |
Suitelets and beforeLoad user events |
The label for a tab or subtab. |