SuiteScript 2.1 Event Subscriber Scripts: Files and handle Entry

Understand the Event Subscriber script file, SDF definition and asynchronous handle(options) entry point introduced in 2026.2.

·2 min read·125 views·View Oracle Docs

An Event Subscriber uses SuiteScript 2.1 for asynchronous follow-up processing. Its event subscriptions are configured through a SuiteCloud project, rather than inferred from the JavaScript file alone.

Prepare both files

Oracle's reference requires a script file and an Event Subscriber SDF object definition. The definition references the script and specifies at least one subscription criterion. Use Oracle's supported event and record combinations when authoring the definition.

Understand handle(options)

Oracle documents handle(options) from NetSuite 2026.2, returning Promise<void>. The provided context includes context.recordType; the payload includes payload.recordId.

A script declares @NApiVersion 2.1 and @NScriptType EventSubscriber, then exports the handle entry point. Those annotations belong in the script's JSDoc header; they are not standalone JavaScript statements.

Validate the subscription, then the business behavior

Start with a narrowly scoped supported event in a sandbox. Confirm the intended record triggers the subscriber, inspect the supplied identifiers, and only then add the business action. Define what a safe retry or repeated action means for that action. This is an editorial implementation checklist, not a claim about delivery guarantees or automatic retry behavior.

Use an Event Subscriber for work that can happen asynchronously. For behavior required during the originating record operation, evaluate the appropriate User Event entry point separately.

Sources: Oracle's Event Subscriber overview, script reference, handle reference, and code samples.

Continue with the SuiteScript guides. No subscriber was deployed or executed as part of preparing this article.

Frequently Asked Questions (4)

Is a JavaScript file alone enough to configure subscriptions?
No. Include the Event Subscriber SDF definition with subscription criteria and a reference to the script file.
What does handle(options) return?
Oracle documents Promise<void> for the handle entry point.
Which identifiers does the entry point receive?
The documented parameters include context.recordType and payload.recordId.
Should an Event Subscriber enforce a rule during the originating record operation?
Its purpose is asynchronous follow-up processing. Evaluate a suitable User Event entry point for behavior required during the originating operation.

Weekly Update History (1)

SuiteScriptadded

Added the SuiteScript 2.1 Event Subscriber Script Type topic and related reference, code sample, and API topics to explain how to create scripts that run asynchronously after supported record events.

View Oracle Docs
Source: SuiteScript 2.1 Event Subscriber Script Type — Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in General

View all General articles →