serverWidget.FieldType

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 values for supported field types. This enum is used to set the value of the type parameter when Form.addField(options) is called.

Important:

Long text fields created with SuiteScript have a character limit of 100,000. Long text fields created with SuiteBuilder have a character limit of 1,000,000.

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

  • CHECKBOX

  • CURRENCY

  • DATE

  • DATETIME

  • DATETIMETZ

  • EMAIL

  • FILE

  • FLOAT

  • HELP

  • INLINEHTML

  • INTEGER

  • IMAGE

  • LABEL

  • LONGTEXT

  • MULTISELECT

  • PASSWORD

  • PERCENT

  • PHONE

  • SELECT

  • RADIO

  • RICHTEXT

  • TEXT

  • TEXTAREA

  • TIMEOFDAY

  • URL

Consider the following as you work with these field types:

  • The DATETIME field type is not supported with addField methods, you must specify DATETIMETZ.

  • The FILE field type is available only for Suitelets and will appear on the main tab of the Suitelet page. FILE fields cannot be added to tabs, subtabs, sublists, or field groups and are not allowed on existing pages. It is not supported with List.addColumn(options).

  • The IMAGE field type is available only for fields that appear on lists, static list sublists or forms.

  • The INLINEHTML field type should be considered as a 'write-only' type of field used to add a field on a form. The INLINEHTML field type does not support labels. The label parameter is required for all field types, but the UI does not display the labels specified for INLINEHTML fields. If you want to display an INLINEHTML field with a label, add a separate custom LABEL field.

  • All field types that work with text handle input as plain text, except for the INLINEHTML field type. HTML input is supported only in the INLINEHTML field type.

  • Radio buttons that are inside one container are exclusive. The method addField on form has an optional parameter container. For an example, see FieldGroup.label.

  • The DATETIME, FILE, HELP, INLINEHTML, LABEL, LONGTEXT, MULTISELECT, RADIO and RICHTEXT field types are not supported with Sublist.addField(options).

  • The CHECKBOX, DATETIME, DATETIMETZ, FILE, HELP, INLINEHTML, LABEL, MULTISELECT, SELECT, and RADIO field types are not supported with List.addColumn(options).

For a description of these field types, and additional information regarding character limits and format restrictions, see Field Type Descriptions for Custom Fields.

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 field = form.addField({
    id : 'custpage_text',
    type : serverWidget.FieldType.TEXT,
    label : 'Text'
});
...
//Add additional code 

          

Related Topics

General Notices