saveRecord(scriptContext)

Description

Defines the function that is executed when a record is saved (after the submit button is pressed but before the form is submitted).

The following sample tasks can be performed:

  • Provide alerts before committing the data.

  • Enable fields that were disabled with other functions.

  • Redirect the user to a specified URL.

For an example, see SuiteScript Client Script Sample.

Returns

true if the record is valid and is saved.

false otherwise.

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

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

Related Topics

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

General Notices