Sublist.setSublistValue(options)

Method Description

Sets the value of a sublist field.

Returns

void

Supported Script Types

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

Governance

None

Module

N/ui/serverWidget Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.id

string

required

The internal ID name of the line item field being set.

options.line

number

required

The line number for this field.

Note:

The first line number on a sublist is 0 (not 1).

options.value

string

required

The value for the field being set.

Note:

Checkbox fields accept string (’T’/’F’) values, not Boolean.

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'
});
var sublist = form.addSublist({
    id: 'sublist',
    type: serverWidget.SublistType.INLINEEDITOR,
    label: 'Inline Editor Sublist'
});

sublist.addField({
    id: 'sublist',
    type: ui.FieldType.TEXT,
    label: 'Text Field'
});

sublist.setSublistValue({
    id: 'sublist',
    line: 2,
    value: "Text"
});
...
//Add additional code 

        

Related Topics

General Notices