beforeLoad(context)
Description |
Defines the function that is executed before a record is loaded; that is, whenever a read operation occurs on a record, and prior to returning the record or page. These operations include navigating to a record in the UI, reading a record in SOAP web services, and loading a record. The beforeLoad event cannot be used to source standard records. Use the pageInit client script for this purpose. See pageInit(scriptContext). 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 |
The HTTP request information sent by the browser. If the event was triggered by a server action, this value is not present. |
Version 2015 Release 2 |
|
|
string |
required |
The type of operation invoked by the event (the trigger type). The type can be any of the possible values for the context.UserEventType enum. This parameter allows the script to branch out to different logic depending on the operation type. For example, a script that includes logic to delete a record and all of its child records should only be invoked when User event scripts should always check the value of the type argument to avoid indiscriminate execution. |
Version 2015 Release 2 |
For an example of the beforeLoad entry point, see SuiteScript 2.x User Event Script Sample.