SuiteScript
NetSuite 2026.2
2026-11-13

New N/dataStore Module: Document-Oriented Storage Without Custom Records

SuiteScript 2.1 gains the N/dataStore module, a document-oriented JSON store with collection-based CRUD, async cursors, and SuiteApp-scoped isolation — no custom records required.

Affects:SuiteScript 2.1N/dataStoreSDFSuiteApp Development

What changed

NetSuite introduced the N/dataStore module for SuiteScript 2.1 server scripts. It provides a document-oriented storage layer that persists arbitrary JSON objects (called documents) without requiring you to define custom record types, fields, or sublists. Think of it as a lightweight NoSQL-style store embedded in NetSuite.

Core concepts

  • Data Store — a named container. Obtained via dataStore.getDatastore(id). A default data store is always available.
  • Collection — a named grouping of documents inside a data store. Obtained via Datastore.getCollection(id), or the shortcut dataStore.getCollection(id) which implicitly targets the default data store.
  • Document — a JSON object with a system-generated _id plus your custom properties.

API surface

All Collection methods are async and return Promises. You must use await or .then() to consume results. The key return types are:

  • InsertOneResult / InsertManyResult — generated _id, document metadata, and insertion counts.
  • FindOneResult / FindResult — matching document plus DocumentMetadata (byte size, version).
  • Cursor — async iterator over matching documents.
  • UpdateResult — count of documents updated.
  • DeleteResult — count of documents deleted (via deleteOne or deleteMany).

Storage scoping

The executing script's context determines data isolation:

  • Account scope — all non-SuiteApp scripts in the account share the same data stores and collections when using the same identifiers.
  • SuiteApp scope — each SuiteApp's scripts are isolated from account-scope data and from every other SuiteApp.

Restrictions

  • Server scripts only — not available in client scripts, user-event beforeLoad context on the client side, or Suitelets rendered as forms.
  • No sensitive data — Oracle explicitly warns against storing PII, credentials, or other sensitive information. There is no mention of encryption at rest or field-level access controls.
  • SuiteBundler is not supported — scripts using N/dataStore cannot be installed via SuiteBundler. A script deployed through SDF will fail if it is later bundled. You must use Account Customization Projects (ACP) or Copy to Account for migration.

The release notes do not specify governance costs, document size limits, collection count caps, or query operators for find/delete/update. These details should be verified in the full API reference or through empirical testing before building production workflows on this module.

What to do

  1. Evaluate use cases. This module is a fit for script-local caches, staging areas, transient processing state, or configuration blobs where a full custom record is overkill. It is not a replacement for custom records when you need saved-search support, role-based field access, workflow triggers, or SuiteAnalytics visibility.
  2. Audit your deployment method. If you currently distribute scripts via SuiteBundler, you cannot adopt N/dataStore until you migrate those scripts to SDF Account Customization Projects. Plan that migration first.
  3. Confirm governance and limits. Oracle's documentation does not yet clarify governance unit consumption per operation, maximum document size, or per-collection caps. Run controlled tests in a sandbox with N/runtime.getCurrentScript().getRemainingUsage() before and after calls to measure cost.
  4. Design for scope isolation. Decide up front whether your scripts should share data at the account level or be isolated per SuiteApp. If you later refactor a standalone script into a SuiteApp (or vice versa), the data will be in a different scope and will not carry over automatically.
  5. Handle async correctly. All collection methods return Promises. Wrap calls in async entry points and use await. If you are in a Map/Reduce script, ensure you await in each stage — returning a pending Promise without awaiting it will silently drop the operation.
  6. Do not store sensitive data. No encryption or access-control features are documented. Use N/crypto or external vaults if you need to persist anything confidential.