beforeSubmit(context)
Description |
Defines the function that is executed before a record is submitted; that is, prior to any write operation on the record. Changes made to the current record in this script persist after the write operation. The beforeSubmit event can be used to validate the submitted record, perform any restriction and permission checks, and perform any last-minute changes to the current record. Notes:
This event can be used with the following context.UserEventType:
|
Returns |
void |
Since |
Version 2015 Release 2 |
Parameters
The context
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
required |
The new (or updated) record. |
Version 2015 Release 2 |
|
|
required |
The old record (the previous state of the record). |
Version 2015 Release 2 |
|
|
string |
required |
The trigger type. Use the context.UserEventType enum to set this value. |
Version 2015 Release 2 |
For an example of the beforeSubmit entry point, see SuiteScript 2.x User Event Script Sample.