serverWidget.SublistType

Note:

JavaScript does not include an enumeration type. The SuiteScript 2.x documentation uses the term enumeration (or enum) to describe a plain JavaScript object with a flat, map-like structure. In this object, each key points to a read-only string value.

Enum Description

Holds the string values for valid sublist types. This enum is used to define the type parameter when Form.addSublist(options) is called

Supported Script Types

SuiteScript 2.x Suitelet Script Type and SuiteScript 2.x User Event Script Type (beforeLoad(context))

Module

N/ui/serverWidget Module

Since

2015.2

Values

Value

Description

INLINEEDITOR

These types of sublists are both fully editable. The only difference between these types is their appearance in the UI:

  • With an inline editor sublist, a new line is displayed at the bottom of the list after existing lines. To add a line, a user working in the UI clicks inside the new line and adds a value to each column as appropriate. Examples of this style include the Item sublist on the sales order record and the Expense sublist on the expense report record.

  • With an editor sublist, a user in the UI adds a new line by working with fields that are displayed above the existing sublist lines. This style is not common on standard NetSuite record types.

EDITOR

LIST

This type of sublist has a fixed number of lines. You can update an existing line, but you cannot add lines to it.

Note:

To make a field within a LIST type sublist editable, use Field.updateDisplayType(options) and the enum serverWidget.FieldDisplayType to update the field display type to ENTRY.

STATICLIST

This type of sublist is read-only. It cannot be edited in the UI, and it is not available for scripting.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/ui/serverWidget Module Script Samples.

            //Add additional code 
...
var form = serverWidget.createForm({
    title : 'Simple Form with Inline Editor type Sublist'
});
var sublist = form.addSublist({
    id : 'sublist',
    type : serverWidget.SublistType.INLINEEDITOR,
    label : 'Inline Editor Sublist'
});
...
//Add additional code 

          

The following code sample shows how to make a field within a LIST type sublist editable by updating the fieldDisplayType to ENTRY.

            //Add additional code 
...
var form = serverWidget.createForm({
    title : 'Simple Form with List type Sublist'
});
var sublist = form.addSublist({
    id : 'sublist',
    type : serverWidget.SublistType.LIST,
    label : 'List Type Sublist'
});
var internalId = sublist.addField({
         id : 'id',
         label : 'Internal ID',
     type : serverWidget.FieldType.TEXT
});
internalId.updateDisplayType({displayType: serverWidget.FieldDisplayType.ENTRY});
...
//Add additional code 

          

Related Topics

General Notices