New N/runtime Method: runtime.isNextActive() Detects NetSuite Next UI
SuiteScript 2.1 gains runtime.isNextActive() in the N/runtime module, letting scripts detect whether the current user is running under the NetSuite Next UI so you can branch logic accordingly.
What changed
A new method runtime.isNextActive() has been added to the N/runtime module starting in 2026.1. It returns a boolean indicating whether the NetSuite Next UI experience is active for the user executing the script.
Key details
- Module:
N/runtime - Return type:
boolean - Governance: None (zero governance cost)
- Supported script types: All client and server script types (Client, User Event, Suitelet, Restlet, Scheduled, Map/Reduce, etc.)
Scheduled and Map/Reduce caveat
For Scheduled Scripts and Map/Reduce Scripts, the return value depends on which user context NetSuite uses to run the script. If the script executes as the System user (the default when no specific employee is configured), isNextActive() returns false regardless of whether NetSuite Next is deployed in the account. To get a meaningful result you must ensure the script runs under a named employee whose UI preference is set to NetSuite Next.
Why it matters
NetSuite Next introduces UI-layer changes that can affect client-side behavior, field rendering, and sublists. Scripts that manipulate the DOM, inject custom HTML, or rely on classic UI CSS selectors may need separate code paths. This method gives you a clean, governance-free way to branch logic at runtime without inspecting the DOM or user-agent strings.
What to do
- Identify scripts with UI-dependent logic. Client Scripts that manipulate the DOM or depend on classic-UI CSS classes are the primary candidates. Use
runtime.isNextActive()to gate those code paths. - Update your module dependencies. Add or confirm
N/runtimein yourdefinearray:define(['N/runtime'], (runtime) => { if (runtime.isNextActive()) { // NetSuite Next-specific logic } else { // Classic UI logic } }); - Review Scheduled / Map/Reduce scripts. If you plan to use this method in background scripts, confirm the deployment's Execute As Role or Execute As User is set to a named employee rather than the System user, otherwise the method will always return
false. - Test in both UI modes. Toggle NetSuite Next on and off for a test user and verify your branching behaves correctly in each mode before deploying to production.
Source: Oracle NetSuite Release Notes