netsuite · suitescript · suitescript-2-1
NetSuite 2026.2 Event Subscriber Scripts: What They Change for SuiteScript
NetSuite 2026.2 adds Event Subscriber scripts for asynchronous work after a record event. How they differ from User Events, and where the design bites.
Update, October 20, 2026 (revised October 28). The Event Subscriber documentation is back in the NetSuite Help Center, and the script type is listed in the October Monthly Release for NetSuite 2026.2. Oracle had removed the pages at some point between August 19 and September 24 and published them again on October 19, 2026, without explaining the gap. The October note sits under the NetSuite Next banner, which Oracle is rolling out in phases, so the script type may not be available in your account yet. One number changed: the current documentation gives a limit of 300 seconds per execution, not the 3,600 seconds this article originally cited. In August, developers who tried to deploy it hit
Platform Events are not enabled for this account; the restored documentation does not mention that error, so test in a sandbox before you build on it (see the deployment section). The sources below now point to the live Oracle pages. The history of the removal is in What happened to NetSuite Event Subscriber.
NetSuite 2026.2 adds a new SuiteScript type: Event Subscriber.
It runs SuiteScript 2.1 after a supported record event, such as a record being created, updated, or deleted. The originating operation completes first, so the subscriber is intended for follow-up work that should not delay the save itself.[1] [5]
That sounds close to an asynchronous User Event. It is not quite that.
The important difference is the execution model: a User Event participates in record processing, while an Event Subscriber reacts after the operation has completed.
The problem Event Subscriber is trying to solve
A typical afterSubmit script often ends up doing too much:
- loading related records;
- making an HTTP request;
- sending an email or notification;
- creating an integration record;
- updating a second record;
- running business logic that is not required to save the original record.
That code may be logically post-submit, but it still sits in the request path of the originating operation.
The new model is closer to this:
This is useful when the extra processing matters, but does not need to finish before the user or integration receives the result of the original operation.
For example, a notification after an invoice is created is a reasonable subscriber use case. Blocking the invoice save until a third-party notification service responds is usually not.
Event Subscriber versus User Event
User Event scripts expose the familiar lifecycle points:
beforeLoad;beforeSubmit;afterSubmit.
They are still the right tool when the script must validate, modify, or reject the originating operation.
Use a User Event when you need to:
- prevent a record from being saved;
- set a value before persistence;
- validate fields synchronously;
- modify the form in
beforeLoad; - guarantee that the logic has finished before the operation returns.
Use an Event Subscriber when the operation can finish first and the remaining work can be handled asynchronously.
That makes Event Subscriber a complement to User Events, not a replacement for them.
The practical first step is knowing which of your existing afterSubmit scripts are doing follow-up work. MokuBot is an AI agent for NetSuite that works from a side panel inside your account, under the permissions you give it: it reads execution logs, runs SuiteQL and writes SuiteScript, so it can help you go through current User Event scripts and their logs before you decide what moves. It installs from the Chrome Web Store with a free 30-day trial.
How an Event Subscriber is deployed
The current implementation is SDF-based. An Event Subscriber needs two pieces:
- a SuiteScript 2.1 file with a
handle(options)entry point; - an SDF
eventsubscriberobject that points to the file and defines the subscription criteria.[2] [6]
The JavaScript file can be minimal:
/**
* @NApiVersion 2.1
* @NScriptType EventSubscriber
*/
define([], () => {
async function handle(options) {
const recordType = options.context.recordType;
const recordId = options.payload.recordId;
log.audit({
title: 'Event Subscriber triggered',
details: {
recordType,
recordId
}
});
}
return {
handle
};
});
The entry point receives the record type in options.context.recordType and the internal ID of the triggering record in options.payload.recordId.[4]
One practical consequence is that the subscriber does not receive the usual User Event newRecord and oldRecord objects. If it needs the record data, it must load the record or query the relevant fields separately.
/**
* @NApiVersion 2.1
* @NScriptType EventSubscriber
*/
define(['N/record'], (record) => {
async function handle(options) {
const recordType = options.context.recordType;
const recordId = options.payload.recordId;
if (recordType !== 'SALESORDER') {
return;
}
const salesOrder = record.load({
type: record.Type.SALES_ORDER,
id: recordId
});
const customerId = salesOrder.getValue({
fieldId: 'entity'
});
log.audit({
title: 'Sales Order processed',
details: {
recordId,
customerId
}
});
}
return { handle };
});
The subscription criteria live in XML
The SDF object defines which events trigger the script. A basic subscription to Sales Order creation looks like this:
<eventsubscriber scriptid="custevsub_salesorder">
<scriptfilepath>[/SuiteScripts/eventSubscriber.js]</scriptfilepath>
<criteria>
<criterion>
<domain>RECORD</domain>
<type>CREATED</type>
<parameters>
<parameter>
<name>RECORDTYPE</name>
<operator>EQ</operator>
<value>SALESORDER</value>
</parameter>
</parameters>
</criterion>
</criteria>
</eventsubscriber>
The scriptid can be up to 27 characters and must match the name of the object definition file, so this object lives in Objects/custevsub_salesorder.xml.[6] [9]
The same object can contain multiple criteria. The handler can then branch on recordType and apply different logic for Sales Orders, Customers, or other supported records.[2]
Keep these filters narrow. A subscriber that listens to every update of a high-volume record type can create a large amount of background work before the business logic has even become interesting.
Check that it deploys in your account first
The SDF reference lists one feature dependency for the eventsubscriber object, SERVERSIDESCRIPTING.[9] In August, developers who deployed exactly this kind of object to 2026.2 accounts got Platform Events are not enabled for this account, an account feature that the documentation does not mention.[10] The October release also sits under NetSuite Next, which Oracle is rolling out in phases.[5]
So before you move any logic, deploy a minimal subscriber like the one above to a sandbox, create a matching record, and confirm the handler ran. If the deployment fails with the Platform Events error, the script type is not available to that account yet. The history of that error is in What happened to NetSuite Event Subscriber.
Where this is useful
Notifications after record creation
An invoice is created, and a notification must be sent to an external service. The notification is important, but it should not determine whether the invoice save is fast or successful.
Integration events
A record change can be converted into an integration event:
For a critical integration, I would keep the subscriber thin. It should record the event or create a queue item, while a separate processor handles delivery, retries, and error state.
A direct HTTP call from handle() may be enough for a low-risk notification. It is a poor default for a financial or operational integration where losing an event is unacceptable.
Secondary updates
A Customer changes, and a custom record, integration status, or search-supporting table needs to be updated. If that update is not required for the Customer operation itself, moving it out of the synchronous path makes the main operation simpler.
Technical audit events
A subscriber can also write a technical event record containing:
- record type;
- record ID;
- event type;
- processing status;
- correlation ID;
- error details.
That gives the integration layer something observable instead of hiding all processing inside a large afterSubmit script.
The sharp edges
It is not a transaction hook
An Event Subscriber cannot be used to reject the original operation. If the subscriber fails, the record may already exist or the update may already be committed.
That is the feature, but also the risk. Errors become asynchronous operational failures rather than immediate validation errors.
The handler may read a later state
The subscriber receives a record ID, not a full event snapshot. If the record changes again before the subscriber loads it, the handler may see the newer state rather than the exact state that existed when the event was generated.
For most “process the current record” workflows this is fine. For precise change capture, store the relevant values in an event or queue record before relying on them downstream.
Delivery semantics need verification
The documentation describes the script type, criteria, entry point, and limits. It says nothing about retries, duplicate delivery, ordering, or what happens when a handler fails.[1] [3] [4] Developers who tried the script type in August noticed the same gap; one wrote that their assumption "is that there is no retry mechanism on these scripts".[10]
Until those semantics are confirmed in the target account, design the handler as if it can run more than once and as if an external call can fail.
That means idempotency is not optional:
if (alreadyPublished(invoiceId)) {
return;
}
publishInvoice(invoiceId);
markAsPublished(invoiceId);
In a real integration, the status update itself also needs a failure strategy. A queue record with RECEIVED, PROCESSING, SUCCESS, and FAILED states is easier to operate than an untracked HTTP request.
Governance and runtime limits
The October Monthly Release for NetSuite 2026.2 specifies up to 1,000 usage units and up to 300 seconds for one Event Subscriber execution.[5] [7] [8] An earlier version of this article cited 3,600 seconds, taken from secondary coverage of the August release; the current Oracle documentation says 300.
That is enough for a notification or a queue insertion. It is not enough for heavy processing, and five minutes is a hard ceiling, not a target.
Watch for:
- repeated
record.load()calls; - large searches or SuiteQL queries;
- many
submitFields()calls; - multiple external requests;
- cascaded updates that create more events;
- subscriber logic that re-triggers itself indirectly.
For heavier work, use the subscriber as an event capture layer and pass the item to Map/Reduce, a queue, or an external worker.
The design I would use
For a production integration, the default architecture should be:
This keeps the subscriber small and makes the difficult parts explicit: retries, duplicate delivery, monitoring, and recovery.
The main opinion here is simple: do not treat Event Subscriber as a place to move every afterSubmit script. Treat it as a thin event boundary.
That distinction matters. Moving a 500-line synchronous script into handle() does not create a reliable event-driven architecture. It only moves the same failure modes to a different execution point.
Event Subscriber is most valuable when it gives the system a clean handoff from the record transaction to an observable, retryable processing pipeline.
Sources
[1] Oracle Help Center: SuiteScript 2.1 Event Subscriber Script Type (article_8125656702)
[2] Oracle Help Center: SuiteScript 2.1 Event Subscriber Script Code Samples (article_6163616630)
[3] Oracle Help Center: SuiteScript 2.1 Event Subscriber Script Reference (article_9100524953)
[4] Oracle Help Center: handle(options) (article_9100524955)
[5] Oracle Help Center: NetSuite 2026.2 October Monthly Release (article_84180824601)
[6] Oracle Help Center: Event Subscriber Scripts as XML Definitions (article_47180719123)
[7] Oracle Help Center: Script Type Usage Unit Limits
[8] Oracle Help Center: Script Execution Time Limits
[9] Oracle Help Center: eventsubscriber SDF object (article_7110236124)
[10] NetSuite Professionals: thread on deploying Event Subscriber in 2026.2 accounts, August 21 to September 14, 2026
The pages were removed from the Help Center between August 19 and September 24, 2026 (archived table of contents from August 19) and restored on October 19, 2026.