fieldChanged(scriptContext)

Description

Defines the function that is executed when a field is changed by a user or client call.

This event may also execute directly through beforeLoad user event scripts.

The following sample tasks can be performed:

  • Provide the user with additional information based on user input.

  • Disable or enable fields based on user input.

For an example, see SuiteScript Client Script Sample.

Note:

This event does not execute when the field value is changed or entered in the page URL. Use the pageInit function to handle URLs that may contain updated field values. See pageInit(scriptContext).

Returns

void

Since

Version 2015 Release 2

Parameters
Note:

The scriptContext parameter is a JavaScript object. It is automatically passed to the script entry point by NetSuite.

Parameter

Type

Description

Since

scriptContext.currentRecord

currentRecord.CurrentRecord

The current form record.

For more information about CurrentRecord object members, see CurrentRecord Object Members.

Version 2015 Release 2

scriptContext.sublistId

string

The sublist ID name.

Version 2015 Release 2

scriptContext.fieldId

string

The field ID name.

Version 2015 Release 2

scriptContext.line

string

The line number (zero-based index) if the field is in a sublist or a matrix.

If the field is not a sublist or matrix, the default value is undefined.

Version 2015 Release 2

scriptContext.column

string

The column number (zero-based index) if the field is in a matrix.

If the field is not in a matrix, the default value is undefined.

Version 2015 Release 2

For an example of the fieldChanged entry point, see SuiteScript Client Script Sample.

Related Topics

SuiteScript 2.x Client Script Entry Points and API
lineInit(scriptContext)
pageInit(scriptContext)
postSourcing(scriptContext)
saveRecord(scriptContext)
sublistChanged(scriptContext)
validateDelete(scriptContext)
validateField(scriptContext)
validateInsert(scriptContext)
validateLine(scriptContext)
localizationContextEnter(scriptContext)
localizationContextExit(scriptContext)

General Notices