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).

Important:

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 .

Important:

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

serverWidget.Assistant

Object

Suitelets and beforeLoad user events

A scriptable, multi-step NetSuite assistant.

serverWidget.AssistantStep

Object

Suitelets and beforeLoad user events

A step within a custom NetSuite assistant.

serverWidget.Button

Object

Suitelets and beforeLoad user events

A button that appears in a UI object.

serverWidget.Field

Object

Suitelets and beforeLoad user events

A NetSuite field.

serverWidget.FieldGroup

Object

Suitelets and beforeLoad user events

A field group.

serverWidget.Form

Object

Suitelets and beforeLoad user events

A NetSuite form.

serverWidget.List

Object

Suitelets and beforeLoad user events

A list.

serverWidget.ListColumn

Object

Suitelets and beforeLoad user events

A list column.

serverWidget.Sublist

Object

Suitelets and beforeLoad user events

A NetSuite sublist.

serverWidget.Tab

Object

Suitelets and beforeLoad user events

A NetSuite tab and subtabs.

Method

serverWidget.createAssistant(options)

serverWidget.Assistant

Suitelets and beforeLoad user events

Creates and returns a new assistant object.

serverWidget.createForm(options)

serverWidget.Form

Suitelets and beforeLoad user events

Creates and returns a new form object.

serverWidget.createList(options)

serverWidget.List

Suitelets and beforeLoad user events

Creates a List object (specifying the title, and whether to hide the navigation bar).

Enum

serverWidget.AssistantSubmitAction

string (read-only)

Suitelets and beforeLoad user events

Holds the string values for submit actions performed by the user.

serverWidget.FieldBreakType

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.

serverWidget.FieldDisplayType

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.

serverWidget.FieldLayoutType

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.

serverWidget.FieldType

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.

serverWidget.FormPageLinkType

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 type parameter for Form.addPageLink(options).

serverWidget.LayoutJustification

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.

serverWidget.ListStyle

string (read-only)

Suitelets and beforeLoad user events

Holds the string values for supported list styles. This enum is used to set the value of the List.style property.

serverWidget.SublistDisplayType

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.

serverWidget.SublistType

string (read-only)

Suitelets and beforeLoad user events

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

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

Assistant.addField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Adds a field to an assistant.

Assistant.addFieldGroup(options)

serverWidget.FieldGroup

Suitelets and beforeLoad user events

Adds a field group to an assistant.

Assistant.addStep(options)

serverWidget.AssistantStep

Suitelets and beforeLoad user events

Adds a step to an assistant.

Assistant.addSublist(options)

serverWidget.Sublist

Suitelets and beforeLoad user events

Adds a sublist to an assistant.

Assistant.getField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Gets a field object.

Assistant.getFieldGroup(options)

serverWidget.FieldGroup

Suitelets and beforeLoad user events

Gets a field group object.

Assistant.getFieldGroupIds()

string[]

Suitelets and beforeLoad user events

Gets all the field group IDs in an assistant.

Assistant.getFieldIds()

string[]

Suitelets and beforeLoad user events

Gets all the field IDs in an assistant.

Assistant.getFieldIdsByFieldGroup(fieldGroup)

string[]

Suitelets and beforeLoad user events

Gets all field IDs in the assistant field group.

Assistant.getLastAction()

string

Suitelets and beforeLoad user events

Gets the last action submitted by the user.

Assistant.getLastStep()

serverWidget.AssistantStep

Suitelets and beforeLoad user events

Gets the step that the last submitted action came from.

Assistant.getNextStep()

serverWidget.AssistantStep

Suitelets and beforeLoad user events

Gets the next step prompted by the assistant.

Assistant.getStep(options)

serverWidget.AssistantStep

Suitelets and beforeLoad user events

Returns a step in an assistant.

Assistant.getStepCount()

number

Suitelets and beforeLoad user events

Gets the total count of steps in the assistant.

Assistant.getSteps()

serverWidget.AssistantStep[]

Suitelets and beforeLoad user events

Gets all the steps in the assistant.

Assistant.getSublist(options)

serverWidget.Sublist

Suitelets and beforeLoad user events

Get a Sublist object from its ID.

Assistant.getSublistIds()

string[]

Suitelets and beforeLoad user events

Gets all the sublist IDs in an assistant.

Assistant.hasErrorHtml()

Boolean

Suitelets and beforeLoad user events

Indicates whether the assistant has an error message to display.

Assistant.isFinished()

Boolean

Suitelets and beforeLoad user events

Indicates the status of the assistant. If set to true, the assistant is finished.

Assistant.sendRedirect(options)

void

Suitelets and beforeLoad user events

Manages redirects in an assistant.

Assistant.setSplash(options)

void

Suitelets and beforeLoad user events

Define a splash message.

Assistant.updateDefaultValues(values)

void

Suitelets and beforeLoad user events

Sets the default values of an array of fields that are specific to the assistant.

Property

Assistant.clientScriptFileId

number

Suitelets and beforeLoad user events

The File Cabinet ID of client script file to be used in this assistant.

Assistant.clientScriptModulePath

string

Suitelets and beforeLoad user events

The relative path to the client script file to be used in this assistant.

Assistant.currentStep

serverWidget.AssistantStep (read-only)

Suitelets and beforeLoad user events

The current step.

Assistant.errorHtml

string

Suitelets and beforeLoad user events

The error message text.

Assistant.finishedHtml

string

Suitelets and beforeLoad user events

The text displayed after an assistant is finished.

Assistant.hideAddToShortcutsLink

Boolean

Suitelets and beforeLoad user events

Whether the Add to Shortcuts Link is displayed in the UI.

Assistant.hideStepNumber

Boolean

Suitelets and beforeLoad user events

Whether the current and total step numbers are displayed in the UI.

Assistant.isNotOrdered

Boolean

Suitelets and beforeLoad user events

Whether assistant steps are ordered or unordered.

Assistant.title

string

Suitelets and beforeLoad user events

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

AssistantStep.getFieldIds()

string[]

Suitelets and beforeLoad user events

Gets all the field IDs in an assistant step.

AssistantStep.getLineCount(options)

number

Suitelets and beforeLoad user events

Gets the number of lines previously entered by a user in a step.

AssistantStep.getLineCount(options)

string[]

Suitelets and beforeLoad user events

Gets all the field IDs in a list.

AssistantStep.getSublistValue(options)

string

Suitelets and beforeLoad user events

Gets the current value of a sublist field (line item) in a step.

AssistantStep.getSubmittedSublistIds()

string[]

Suitelets and beforeLoad user events

Gets the IDs for all the sublist fields (line items) in a step.

AssistantStep.getValue(options)

string | string[]

Suitelets and beforeLoad user events

Gets the current value of a field.

Property

AssistantStep.helpText

string

Suitelets and beforeLoad user events

The help text for a step.

AssistantStep.id

string (read-only)

Suitelets and beforeLoad user events

The internal ID of the step.

AssistantStep.label

string

Suitelets and beforeLoad user events

The label for a step.

AssistantStep.stepNumber

number

Suitelets and beforeLoad user events

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

Button.isDisabled

Boolean

Suitelets and beforeLoad user events

Whether a button is grayed-out and disabled.

Button.isHidden

Boolean

Suitelets and beforeLoad user events

Whether the button is hidden in the UI.

Button.label

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

Field.addSelectOption(options)

void

Suitelets and beforeLoad user events

Adds a select option to a dropdown list for a selectable field.

Field.getSelectOptions(options)

Object[]

Suitelets and beforeLoad user events

Returns the internal ID and label of the options for a select field as name/value pairs.

Field.setHelpText(options)

serverWidget.Field

Suitelets and beforeLoad user events

Sets the help text that appears in the field help popup.

Field.updateBreakType(options)

serverWidget.Field

Suitelets and beforeLoad user events

Updates the break type used to add a break in flow layout for the field.

Field.updateDisplaySize(options)

serverWidget.Field

Suitelets and beforeLoad user events

Updates the height and width for the field.

Field.updateDisplayType(options)

serverWidget.Field

Suitelets and beforeLoad user events

Updates the type of display for the field.

Field.updateLayoutType(options)

serverWidget.Field

Suitelets and beforeLoad user events

Updates the layout type for the field.

Property

Field.alias

string

Suitelets and beforeLoad user events

The alias used to set the field value.

Field.defaultValue

string

Suitelets and beforeLoad user events

The default value for the field.

Field.helpText

string (read-only)

Suitelets and beforeLoad user events

The help text for the field.

Field.id

string (read-only)

Suitelets and beforeLoad user events

The internal ID for the field.

Field.isMandatory

Boolean

Suitelets and beforeLoad user events

Whether the field is required.

Field.label

string

Suitelets and beforeLoad user events

The label for the field.

Field.linkText

string

Suitelets and beforeLoad user events

The text displayed for a link in place of the URL.

Field.maxLength

number

Suitelets and beforeLoad user events

The maximum length, in characters, for the field.

Field.padding

number

Suitelets and beforeLoad user events

The number of empty vertical character spaces above the field.

Field.richTextHeight

number

Suitelets and beforeLoad user events

The height of a rich text field, in pixels.

Field.richTextWidth

number

Suitelets and beforeLoad user events

The width of a rich text field, in pixels.

Field.type

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

FieldGroup.isBorderHidden

Boolean

Suitelets and beforeLoad user events

Whether a border appears around the field group.

FieldGroup.isCollapsible

Boolean

Suitelets and beforeLoad user events

Whether the field group is collapsible.

FieldGroup.isCollapsed

Boolean

Suitelets and beforeLoad user events

Whether the field group is initially collapsed or expanded in the default view.

FieldGroup.isSingleColumn

Boolean

Suitelets and beforeLoad user events

Whether the field group is displayed in a single column.

FieldGroup.label

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

Form.addButton(options)

serverWidget.Button

Suitelets and beforeLoad user events

Adds a button to the form.

Form.addCredentialField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Adds a field that store credentials in NetSuite for invoking services provided by third parties.

Form.addField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Adds a field to the form.

Form.addFieldGroup(options)

serverWidget.FieldGroup

Suitelets and beforeLoad user events

Adds a group of fields to the form.

Form.addPageInitMessage(options)

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.

Form.addPageLink(options)

void

Suitelets and beforeLoad user events

Adds a link to a form.

Form.addResetButton(options)

serverWidget.Button

Suitelets and beforeLoad user events

Adds a Reset button to a form that clears the values of all fields.

Form.addSecretKeyField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Add a secret key field to the form.

Form.addSublist(options)

serverWidget.Sublist

Suitelets and beforeLoad user events

Adds a sublist to the form.

Form.addSubmitButton(options)

serverWidget.Button

Suitelets and beforeLoad user events

Adds a submit button to a form that saves user inputs.

Form.addSubtab(options)

serverWidget.Tab

Suitelets and beforeLoad user events

Adds a subtab to a form.

Form.addTab(options)

serverWidget.Tab

Suitelets and beforeLoad user events

Adds a tab to a form.

Form.getButton(options)

serverWidget.Button

Suitelets and beforeLoad user events

Returns a button by internal ID.

Form.getField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Returns a field by internal ID.

Form.getSublist(options)

serverWidget.Sublist

Suitelets and beforeLoad user events

Returns a sublist by internal ID.

Form.getSubtab(options)

serverWidget.Tab

Suitelets and beforeLoad user events

Returns a subtab by internal ID.

Form.getTab(options)

serverWidget.Tab

Suitelets and beforeLoad user events

Returns a tab object from its internal ID.

Form.getTabs()

serverWidget.Tab[]

Suitelets and beforeLoad user events

Returns an array of all the tabs in a form.

Form.insertField(options)

void

Suitelets and beforeLoad user events

Inserts a field before another field within a form.

Form.insertSublist(options)

void

Suitelets and beforeLoad user events

Inserts a sublist before another sublist on a form.

Form.insertSubtab(options)

void

Suitelets and beforeLoad user events

Inserts a subtab before another subtab on a form.

Form.insertTab(options)

void

Suitelets and beforeLoad user events

Inserts a tab before another tab on a form.

Form.removeButton(options)

void

Suitelets and beforeLoad user events

Removes a button from a form.

Form.updateDefaultValues(options)

void

Suitelets and beforeLoad user events

Sets the default values of many fields on a form.

Property

Form.clientScriptFileId

number

Suitelets and beforeLoad user events

The File Cabinet ID of client script file to be used in this form.

Form.clientScriptModulePath

string

Suitelets and beforeLoad user events

The relative path to the client script file to be used in this form.

Form.title

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

List.addButton(options)

serverWidget.Button

Suitelets and beforeLoad user events

Adds a button to a list.

List.addColumn(options)

serverWidget.ListColumn

Suitelets and beforeLoad user events

Adds a column to a list.

List.addEditColumn(options)

serverWidget.ListColumn

Suitelets and beforeLoad user events

Adds a column containing Edit or Edit/View links to a Suitelet or Portlet list.

List.addPageLink(options)

serverWidget.List

Suitelets and beforeLoad user events

Adds a link to a list.

List.addRow(options)

serverWidget.List

Suitelets and beforeLoad user events

Adds a single row to a list.

List.addRows(options)

serverWidget.List

Suitelets and beforeLoad user events

Adds multiple rows to a list.

Property

List.clientScriptFileId

number

Suitelets and beforeLoad user events

The File Cabinet ID of client script file to be used in this list.

List.clientScriptModulePath

string

Suitelets and beforeLoad user events

The relative path to the client script file to be used in this list.

List.style

string

Suitelets and beforeLoad user events

The display style for this list.

List.title

string

Suitelets and beforeLoad user events

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

ListColumn.addParamToURL(options)

serverWidget.ListColumn

Suitelets and beforeLoad user events

Adds a URL parameter (optionally defined per row) to the list column's URL.

ListColumn.setURL(options)

serverWidget.ListColumn

Suitelets and beforeLoad user events

Sets the base URL for the list column.

Property

ListColumn.label

string

Suitelets and beforeLoad user events

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

Sublist.addButton(options)

serverWidget.Button

Suitelets and beforeLoad user events

Adds a button to a sublist.

Sublist.addField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Add a field to a sublist.

Sublist.addMarkAllButtons()

serverWidget.Button[]

Suitelets and beforeLoad user events

Adds a Mark All or Unmark All button.

Sublist.addRefreshButton()

serverWidget.Button

Suitelets and beforeLoad user events

Adds a Reset button.

Sublist.getField(options)

serverWidget.Field

Suitelets and beforeLoad user events

Returns a Field object on a specified sublist.

Sublist.getSublistValue(options)

string

Suitelets and beforeLoad user events

Gets a field value on a sublist.

Sublist.setSublistValue(options)

void

Suitelets and beforeLoad user events

Sets the value of a sublist field.

Sublist.updateTotallingFieldId(options)

serverWidget.Sublist

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.

Sublist.updateUniqueFieldId(options)

serverWidget.Sublist

Suitelets and beforeLoad user events

Updates a field ID that is to have unique values across the rows in the sublist.

Property

Sublist.displayType

string

Suitelets and beforeLoad user events

The display style for a sublist.

Sublist.helpText

string

Suitelets and beforeLoad user events

The inline help text for a sublist.

Sublist.label

string

Suitelets and beforeLoad user events

The label for a sublist.

Sublist.lineCount

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

Tab.helpText

string

Suitelets and beforeLoad user events

The inline help text for a tab or subtab.

Tab.label

string

Suitelets and beforeLoad user events

The label for a tab or subtab.

N/ui/serverWidget Module Script Samples

The following script samples demonstrate how to use the features of the N/ui/serverWidget module:

See Complete Custom List Page Sample Script for a sample of a List page, and Sample Custom Assistant Script for a sample of an Assistant.

Create a Custom Form with a Submit Button, Fields, and an Inline Editor Sublist

The following sample creates a Suitelet that generates a sample form with a submit button, fields, and an inline editor sublist.

Note:

This script sample uses the define function, which is required for an entry point script (a script you attach to a script record and deploy). You must use the require function if you want to copy the script into the SuiteScript Debugger and test it. For more information, see SuiteScript 2.x Global Objects.

Important:

This sample uses SuiteScript 2.1. For more information, see SuiteScript 2.1.

              /**
 * @NApiVersion 2.1
 * @NScriptType Suitelet
 */
define(['N/ui/serverWidget'], (serverWidget) => {
    const onRequest = (scriptContext) => {
        if (scriptContext.request.method === 'GET') {
            let form = serverWidget.createForm({
                title: 'Simple Form'
            });

            let field = form.addField({
                id: 'textfield',
                type: serverWidget.FieldType.TEXT,
                label: 'Text'
            });
            field.layoutType = serverWidget.FieldLayoutType.NORMAL;
            field.updateBreakType({
                breakType: serverWidget.FieldBreakType.STARTCOL
            });

            form.addField({
                id: 'datefield',
                type: serverWidget.FieldType.DATE,
                label: 'Date'
            });
            form.addField({
                id: 'currencyfield',
                type: serverWidget.FieldType.CURRENCY,
                label: 'Currency'
            });

            let select = form.addField({
                id: 'selectfield',
                type: serverWidget.FieldType.SELECT,
                label: 'Select'
            });
            select.addSelectOption({
                value: 'a',
                text: 'Albert'
            });
            select.addSelectOption({
                value: 'b',
                text: 'Baron'
            });

            let sublist = form.addSublist({
                id: 'sublist',
                type: serverWidget.SublistType.INLINEEDITOR,
                label: 'Inline Editor Sublist'
            });
            sublist.addField({
                id: 'sublist1',
                type: serverWidget.FieldType.DATE,
                label: 'Date'
            });
            sublist.addField({
                id: 'sublist2',
                type: serverWidget.FieldType.TEXT,
                label: 'Text'
            });

            form.addSubmitButton({
                label: 'Submit Button'
            });

            scriptContext.response.writePage(form);
        } else {
            const delimiter = /\u0001/;
            const textField = scriptContext.request.parameters.textfield;
            const dateField = scriptContext.request.parameters.datefield;
            const currencyField = scriptContext.request.parameters.currencyfield;
            const selectField = scriptContext.request.parameters.selectfield;
            const sublistData = scriptContext.request.parameters.sublistdata.split(delimiter);
            const sublistField1 = sublistData[0];
            const sublistField2 = sublistData[1];

            scriptContext.response.write(`You have entered: ${textField} ${dateField} ${currencyField} ${selectField} ${sublistField1} ${sublistField2}`);
        }
    }

    return {onRequest}
}); 

            

Create a Custom Survey Form

The following sample creates a Suitelet that generates a customer survey form with inline HTML fields, radio fields, and a submit button.

Note:

This script sample uses the define function, which is required for an entry point script (a script you attach to a script record and deploy). You must use the require function if you want to copy the script into the SuiteScript Debugger and test it. For more information, see SuiteScript 2.x Global Objects.

              /**
 * @NApiVersion 2.x
 * @NScriptType Suitelet
 */
define(['N/ui/serverWidget'], function(serverWidget) {
    function onRequest(context) {
        var form = serverWidget.createForm({
            title: 'Thank you for your interest in Wolfe Electronics',
            hideNavBar: true
        });

        var htmlHeader = form.addField({
            id: 'custpage_header',
            type: serverWidget.FieldType.INLINEHTML,
            label: ' '
        }).updateLayoutType({
            layoutType: serverWidget.FieldLayoutType.OUTSIDEABOVE
        }).updateBreakType({
            breakType: serverWidget.FieldBreakType.STARTROW
        }).defaultValue = '<p style=\'font-size:20px\'>We pride ourselves on providing the best' +
            ' services and customer satisfaction.  Please take a moment to fill out our survey.</p><br><br>';

        var htmlInstruct = form.addField({
            id: 'custpage_p1',
            type: serverWidget.FieldType.INLINEHTML,
            label: ' '
        }).updateLayoutType({
            layoutType: serverWidget.FieldLayoutType.OUTSIDEABOVE
        }).updateBreakType({
            breakType: serverWidget.FieldBreakType.STARTROW
        }).defaultValue = '<p style=\'font-size:14px\'>When answering questions on a scale of 1 to 10,' +
            ' 1 = Greatly Unsatisfied and 10 = Greatly Satisfied.</p><br><br>';

        var productRating = form.addField({
            id: 'custpage_lblproductrating',
            type: serverWidget.FieldType.INLINEHTML,
            label: ' '
        }).updateLayoutType({
            layoutType: serverWidget.FieldLayoutType.NORMAL
        }).updateBreakType({
            breakType: serverWidget.FieldBreakType.STARTROW
        }).defaultValue = '<p style=\'font-size:14px\'>How would you rate your satisfaction with our products?</p>';

        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '1',
            source: 'p1'
        }).updateLayoutType({
            layoutType: serverWidget.FieldLayoutType.STARTROW
        });
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '2',
            source: 'p2'
        }).updateLayoutType({
            layoutType: serverWidget.FieldLayoutType.MIDROW
        });
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '3',
            source: 'p3'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '4',
            source: 'p4'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '5',
            source: 'p5'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '6',
            source: 'p6'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '7',
            source: 'p7'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '8',
            source: 'p8'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '9',
            source: 'p9'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoproductrating',
            type: serverWidget.FieldType.RADIO,
            label: '10',
            source: 'p10'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.ENDROW});

        var serviceRating = form.addField({
            id: 'custpage_lblservicerating',
            type: serverWidget.FieldType.INLINEHTML,
            label: ' '
        }).updateLayoutType({
            layoutType: serverWidget.FieldLayoutType.NORMAL
        }).updateBreakType({
            breakType: serverWidget.FieldBreakType.STARTROW
        }).defaultValue = '<p style=\'font-size:14px\'>How would you rate your satisfaction with our services?</p>';

        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '1',
            source: 'p1'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.STARTROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '2',
            source: 'p2'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '3',
            source: 'p3'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '4',
            source: 'p4'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '5',
            source: 'p5'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '6',
            source: 'p6'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '7',
            source: 'p7'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '8',
            source: 'p8'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '9',
            source: 'p9'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.MIDROW});
        form.addField({
            id: 'custpage_rdoservicerating',
            type: serverWidget.FieldType.RADIO,
            label: '10',
            source: 'p10'
        }).updateLayoutType({layoutType: serverWidget.FieldLayoutType.ENDROW});

        form.addSubmitButton({
            label: 'Submit'
        });

        context.response.writePage(form);
    }

    return {
        onRequest: onRequest
    };
}); 

            

Related Topics

SuiteScript 2.x Modules
SuiteScript 2.x
SuiteScript Versioning Guidelines
SuiteScript 2.1
Creating Custom Assistants

General Notices