beforeSubmit(context)
Description |
This function runs before a record is submitted—so before any write operation happens. Any changes you make to the record in this script stick after the write operation. You can use beforeSubmit to validate the record, add restrictions or permission checks, or make last-minute changes. 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 (how the record looked before). |
Version 2015 Release 2 |
|
|
string |
required |
The trigger type—set with context.UserEventType. |
Version 2015 Release 2 |
For an example of the beforeSubmit entry point, see SuiteScript 2.x User Event Script Sample.