afterSubmit(context)
Description |
Runs the function right after a record is submitted. Use afterSubmit for anything you want to happen after a write operation—like sending an email, redirecting a browser, creating related records, or syncing with an external system. 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 is read-only. To edit it, use record.load(options) to load the submitted record, make your changes, and submit it again. |
Version 2015 Release 2 |
|
|
record.Record | null |
required if context.UserEventType is not equal to |
The old record (the previous version) is also read-only. This parameter’s empty when context.UserEventType is CREATE (a new record). |
Version 2015 Release 2 |
|
string |
required |
This is the trigger type—set it using context.UserEventType. |
Version 2015 Release 2 |
Want an example of afterSubmit? Check out the SuiteScript 2.x User Event Script Sample.