# SuiteScript 2.x Modules Reference and Cheat Sheet

> Source: https://netray.co/tools/suitescript-modules-reference
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

A searchable table of the SuiteScript 2.x N/ modules, what each one is for and the methods you reach for most.

## Category

netsuite

## Erp

NetSuite

## Audience

- NetSuite developer
- SuiteScript developer
- NetSuite administrator

## Tool

**Kind:** worksheet

**Mode:** reference

**Columns:**

#### Module

**Key:** module

**Type:** text

#### What it is for

**Key:** purpose

**Type:** text

#### Key methods and objects

**Key:** methods

**Type:** text

**Rows:**

**Module:** N/record

**Purpose:** Create, load, copy, transform, edit and delete records

**Methods:** create, load, copy, transform, submitFields, delete, Record.save

**Module:** N/search

**Purpose:** Saved searches and ad hoc searches

**Methods:** create, load, lookupFields, Search.run, Search.runPaged, createFilter, createColumn

**Module:** N/query

**Purpose:** SuiteAnalytics Workbook queries and SuiteQL

**Methods:** runSuiteQL, runSuiteQLPaged, create, load

**Module:** N/runtime

**Purpose:** Script, user, account and feature context

**Methods:** getCurrentScript, getCurrentUser, accountId, envType, isFeatureInEffect

**Module:** N/log

**Purpose:** Write entries to the Execution Log

**Methods:** debug, audit, error, emergency

**Module:** N/error

**Purpose:** Create and throw structured errors

**Methods:** create, SuiteScriptError

**Module:** N/format

**Purpose:** Convert between strings, dates and numbers by user preference

**Methods:** format, parse

**Module:** N/email

**Purpose:** Send email from a script

**Methods:** send, sendBulk, sendCampaignEvent

**Module:** N/file

**Purpose:** File Cabinet access

**Methods:** create, load, delete, copy, File.save

**Module:** N/https

**Purpose:** Outbound HTTPS calls and secure strings

**Methods:** get, post, put, delete, request, createSecureString

**Module:** N/http

**Purpose:** Outbound HTTP calls

**Methods:** get, post, put, delete, request

**Module:** N/task

**Purpose:** Submit and monitor background tasks

**Methods:** create, checkStatus, TaskType (scheduled script, map/reduce, search, CSV import)

**Module:** N/url

**Purpose:** Resolve URLs for scripts, records and domains

**Methods:** resolveScript, resolveRecord, resolveDomain

**Module:** N/redirect

**Purpose:** Server-side redirects

**Methods:** toSuitelet, toRecord, toSavedSearch, redirect

**Module:** N/render

**Purpose:** Print and PDF output, merge email templates

**Methods:** transaction, xmlToPdf, mergeEmail, statement, packingSlip

**Module:** N/xml

**Purpose:** Parse and query XML

**Methods:** Parser, XPath.select, escape, validate

**Module:** N/encode

**Purpose:** Encode and decode strings

**Methods:** convert, Encoding, Type

**Module:** N/crypto

**Purpose:** Hashes and HMAC

**Methods:** createHash, createHmac, createSecretKey

**Module:** N/cache

**Purpose:** Script-level caching across executions

**Methods:** getCache, Cache.get, Cache.put, Cache.remove

**Module:** N/currentRecord

**Purpose:** Access the record in the browser (client scripts)

**Methods:** get, CurrentRecord.getValue, setValue, getSublistValue

**Module:** N/ui/serverWidget

**Purpose:** Build Suitelet forms and lists

**Methods:** createForm, createList, Form.addField, Form.addSublist, Form.addSubmitButton

**Module:** N/ui/message

**Purpose:** Banner messages in the browser

**Methods:** create, Message.show, Message.hide

**Module:** N/ui/dialog

**Purpose:** Modal dialogs in the browser

**Methods:** alert, confirm, create

**Module:** N/workflow

**Purpose:** Start workflows and fire workflow actions

**Methods:** initiate, trigger

**Module:** N/transaction

**Purpose:** Transaction-level actions

**Methods:** void

**Module:** N/currency

**Purpose:** Exchange rates

**Methods:** exchangeRate

**Module:** N/config

**Purpose:** Load account configuration records

**Methods:** load, Type

**Module:** N/sftp

**Purpose:** SFTP connections from a script

**Methods:** createConnection, Connection.upload, Connection.download, Connection.list

**Module:** N/util

**Purpose:** Small helpers for 2.x scripts

**Methods:** each, extend, isArray, isObject, nanoTime

**Notes:** Method lists are a working summary, not the full API. Confirm signatures and availability in the SuiteScript 2.x API reference for your release. Some modules work only on the server or only in client scripts.

## Content

**Intro:** This is a lookup table for the SuiteScript 2.x N/ modules. Type a module name or a task into the search box and you get the module, what it is for and the methods most often used. It is meant for the moment you know what you want to do and cannot remember which module owns it.

**Sections:**

#### How to use the table

**Body:** Search by module (for example N/query) or by intent (for example pdf, hash, redirect). Each row gives the purpose and the headline methods. Use the export buttons to take the table into Excel or PDF for a team wiki or a new-developer pack. Rows are read-only reference data, so there is nothing to fill in. The table covers the modules developers hit in daily SuiteScript 2.1 work, not every niche module NetSuite ships.

#### Choosing between N/search and N/query

**Body:** N/search is the older, well known route and returns results through column objects. N/query with runSuiteQL lets you write SQL-style statements, join tables in one call and use functions such as BUILTIN.DF for display values. Many developers use N/search for simple saved-search work and N/query for reporting-style reads that need joins. Both consume governance units, and both page results, so use runPaged variants for large sets rather than pulling everything at once.

**Bullets:**

- Use N/record for single record create, edit and transform.
- Use N/search or N/query for set-based reads.
- Use N/task to push heavy work into a Map/Reduce or Scheduled script.

#### Server versus client availability

**Body:** Not every module runs everywhere. N/currentRecord, N/ui/dialog and N/ui/message are for client scripts in the browser. N/ui/serverWidget, N/email, N/file and N/task run on the server. N/record, N/search and N/query run in both contexts with different limits and behavior, and client-side use can be slower and exposes logic to the browser. When a call fails with a module-not-available error, check the script type before anything else.

**Cta:** If your team spends time hand-writing lookups and reports against NetSuite data, ERPray can answer those questions in plain language over read-only data and show the query it ran.

**Faq:**

#### What is the difference between SuiteScript 2.0 and 2.1?

**Answer:** SuiteScript 2.1 supports newer JavaScript syntax such as arrow functions, template literals, let and const. The N/ modules are the same set. New scripts are normally written as 2.1 and the annotation at the top of the file declares the version.

#### Do I need to load every module in define()?

**Answer:** Only load the modules the script uses. List them in the define array and receive them as function parameters in the same order. Loading unused modules adds clutter and does not help performance.

#### Which module should I use for REST calls to other systems?

**Answer:** Use N/https for outbound calls, which supports HTTPS and secure strings for credentials. N/http is available for plain HTTP, but most integrations should use HTTPS.

#### Is this table official NetSuite documentation?

**Answer:** No. It is a working summary written for convenience. The SuiteScript 2.x API reference in the Help Center is the authority for exact method signatures, parameters and release changes.

## Search terms

suitescript 2.1 modules list, suitescript n/record n/search cheat sheet, netsuite suitescript modules reference, suitescript 2.x api reference, n/query runSuiteQL, suitescript module cheat sheet, netsuite developer cheat sheet

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
