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.
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?
What does handle(options) return?
Which identifiers does the entry point receive?
Should an Event Subscriber enforce a rule during the originating record operation?
Weekly Update History (1)
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 DocsWas this article helpful?
More in General
- Email Notification Controls for Imports in NetSuite 2023
Email notification controls enhance NetSuite imports, improving alerts based on user preferences and permissions.
- Enhanced Commitment Credits for Flexible Billing in NetSuite
Commitment Credits in NetSuite SuiteBilling offer enhanced flexibility for usage-based billing across diverse services.
- Close Management and Consolidation Sync Update in NetSuite 2026.2
Updated for NetSuite 2026.2 with setup prerequisites, configuration steps, and Oracle EPM reference resources.
- Managing Custom Tools for AI Integration in NetSuite
Efficiently manage custom tools in NetSuite for AI integration. Discover best practices and key insights for developers.
Advertising
Reach General Professionals
Put your product in front of NetSuite experts who work with General every day.
Sponsor This Category