handle(options)
|
Description |
Defines the function that handles a subscribed event. |
|
Returns |
|
|
Since |
2026.2 |
Parameters
NetSuite automatically passes the options parameter to the script entry point.
|
Parameter |
Type |
Required / Optional |
Description |
Since |
|---|---|---|---|---|
|
|
Object |
required |
Contains context about the event. |
2026.2 |
|
|
string |
required |
The record type ID of the record that triggered the event. |
2026.2 |
|
|
Object |
required |
Contains the event payload. |
2026.2 |
|
|
string |
required |
Internal ID of the record that triggered the event. |
2026.2 |
Syntax
The following example shows the basic syntax for an Event Subscriber script entry point.
/**
* @NApiVersion 2.1
* @NScriptType EventSubscriber
*/
define([], () => {
async function handle(options) {
const recordType = options.context.recordType;
const recordId = options.payload.recordId;
}
return {
handle: handle
};
});