fieldChanged(scriptContext)

Description

This function runs when a user or client changes a field.

This event can also be triggered by beforeLoad user event scripts.

You can use this event to do the following:

  • Give users more info based on what they enter.

  • Turn fields on or off based on user input.

For an example, see SuiteScript Client Script Sample.

Note:

Note that this event won't run if the field value is changed or entered in the page URL. Instead, use the pageInit function to handle updated field values in URLs. See pageInit(scriptContext).

Returns

void

Since

Version 2015 Release 2

Parameters
Note:

The scriptContext parameter is a JavaScript object. NetSuite automatically sends it to your script's entry point.

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 it's not in a sublist or matrix, this value is undefined.

Version 2015 Release 2

scriptContext.column

string

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

If it's not in a matrix, this value is undefined.

Version 2015 Release 2

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

Related Topics

General Notices