beforeLoad(context)
Description |
Runs a function before a record loads—whenever there’s a read operation, and before the record or page is returned. This covers things like navigating to a record in the UI, reading it via SOAP web services, or just loading a record. You can’t use beforeLoad to source standard records. For that, use the pageInit(scriptContext) client script instead. 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/ |
Description |
Since |
---|---|---|---|---|
|
required |
The current form. |
Version 2015 Release 2 |
|
|
required |
The new record (the record being loaded). |
Version 2015 Release 2 |
|
|
optional |
This is the HTTP request info sent by the browser. If a server triggers the event, you won’t see this value. |
Version 2015 Release 2 |
|
|
string |
required |
The type of operation invoked by the event (the trigger type). The type matches any value in the context.UserEventType enum. You can use this parameter to branch your script logic depending on the operation type. For example, only run delete logic when User event scripts should always check the type argument so you don’t run code when you shouldn’t. |
Version 2015 Release 2 |
For an example of the beforeLoad entry point, see SuiteScript 2.x User Event Script Sample.