validateField(scriptContext)

Description

This function checks if a field change is valid when a user or client makes a change.

This event works on fields added by beforeLoad user event scripts.

You can use this function to:

  • Check field lengths.

  • Limit field entries to a specific format.

  • Limit submitted values to a certain range.

  • Check the submission against another related field.

For an example, see SuiteScript Client Script Sample.

Note:

Note that this doesn't work for list or box fields.

Returns

true if the field is valid and the change is successful.

false otherwise.

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 validateField entry point, see SuiteScript Client Script Sample.

Related Topics

General Notices