Integration & DataGlossary

What Is SuiteScript?

Also known as: NetSuite SuiteScript 2.1, SuiteScript 2.x

Definition

SuiteScript is NetSuite's server-side and client-side JavaScript platform for custom business logic. Scripts run on record events, schedules or HTTP calls, and use the N/record, N/search and N/https modules, under governance limits on usage units per execution.

SuiteScript Explained

SuiteScript is how developers extend NetSuite beyond SuiteFlow workflows and field customization. Current work uses SuiteScript 2.x (2.1 adds modern JavaScript syntax), organized as modules loaded with define(), such as N/record, N/search, N/query, N/runtime, N/email and N/https. Scripts are deployed from the Customization > Scripting menu as script records with one or more deployments.

There are several script types. User Event scripts fire on beforeLoad, beforeSubmit and afterSubmit of a record (for example a work order or sales order). Client scripts run in the browser form. Scheduled and Map/Reduce scripts process volume in the background, with Map/Reduce splitting work into parallel stages. Suitelets build custom pages, RESTlets expose custom REST endpoints, and Workflow Action scripts plug into SuiteFlow.

Every script runs under governance: each API call consumes usage units, and a script has a unit cap per execution (for example, a Scheduled script has a far higher cap than a User Event). Concurrency, script execution time and the number of queued Map/Reduce jobs are also limited by the account's SuiteCloud Plus licensing. Good SuiteScript checks remaining units with runtime.getCurrentScript().getRemainingUsage() and is built to resume.

Why It Matters

  • Most NetSuite manufacturing customization (custom costing, label printing, EDI mapping, approval rules) lives in SuiteScript, so it is the main source of upgrade risk and technical debt.
  • RESTlets and the N/https module are the usual integration points for MES, shop-floor and AI agent connections when standard SuiteTalk is not enough.
  • Governance limits cause silent failures in bulk operations such as large cost rollups, so performance work starts with usage-unit analysis.
  • Documenting scripts is hard when authors have left; an AI assistant that reads script records and explains them reduces key-person risk.

In Practice

A manufacturer wants every work order completion to push actual labor hours to its MES dashboard. An afterSubmit User Event script on the Work Order Completion record builds a payload and posts it with N/https. At roughly a few thousand completions per day, the team moves the push into a Map/Reduce script triggered nightly because per-event calls were hitting governance and slowing shop-floor entry.

Frequently Asked Questions

Is SuiteScript the same as SuiteFlow?

No. SuiteFlow is NetSuite's point-and-click workflow builder. SuiteScript is code. Use SuiteFlow for simple approvals and field logic, and SuiteScript when you need loops, external calls, bulk processing or complex validation.

What language is SuiteScript written in?

JavaScript. SuiteScript 2.x uses an AMD-style module system, and 2.1 supports newer ES syntax. Scripts are uploaded to the File Cabinet and linked to a script record.

What is NetSuite governance?

Governance is the cap on usage units a script can consume per execution. Heavy API calls such as record loads and saves cost more units, so large jobs are designed as Map/Reduce or batched Scheduled scripts.

Working with SuiteScript in a live environment? Our engineers do this every day - and our AI agents automate most of it.