SuiteScript 2.x Modules
SuiteScript 2.x APIs are organized into various modules, based on behavior. The following table lists each module and provides a description, the supported script types, and permissions associated with the module. See Setting Roles and Permissions for SuiteScript for more information about permissions.
As a best practice, you should load only the modules that are needed by your script. However, you can load all SuiteScript 2.x modules at one time by passing the modules’ parent directory to the define() statement and its callback function: define(['N'], function(N) {...});
. This is a convenient way to load all modules, however, doing so will sacrifice the performance advantage of loading only the modules that are needed. We provide this feature so that you can test and familiarize yourself with SuiteScript 2.x. You should not load all modules when using a production environment.
Module |
Description |
Supported Script Types* |
Permissions |
---|---|---|---|
Load the N/action module to execute business logic to update the state of a record. Action APIs emulate NetSuite user interface buttons. |
Client and server scripts |
— |
|
Load the N/auth module to change your NetSuite login credentials. |
Server scripts |
— |
|
Load the N/cache module to enable the caching of needed data and improve performance. |
Server scripts |
— |
|
Load the N/certificateControl module to enable scripting access to the Digital Certificates list found at Setup > Company > Certificates. You can use this module to find the correct certificate for a subsidiary and check the file type. For more information, see Digital Signing and Uploading Digital Certificates. |
Server scripts |
Certificate Management |
|
Load modules in the N/commerce namespace to access different assets in the web store context, such as items and shopping cart. The modules within the N/commerce namespace are supported by the latest version of SuiteCommerce and by SuiteCommerce Advanced 2019.2 onwards. |
Client and server scripts |
— |
|
Load the N/compress module to compress, decompress, and archive files. |
Server scripts |
— |
|
Load the N/config module to access NetSuite configuration settings. See config.Type for a list of supported configuration pages. |
Server scripts |
— |
|
Load the N/crypto module to work with hashing, hash-based message authentication (hmac), and symmetrical encryption. You can access a set of wrappers for OpenSSL's hash, hmac, cipher, and decipher methods. |
Server scripts |
— |
|
Load the N/certificate module to sign XML documents or strings with digital certificates using asymmetric cryptography. In addition to signing XML documents, you can create signer and verifier objects and verify signed documents with this module. |
Server scripts |
Certificate Access |
|
Load the N/crypto/random module to work with cryptographically-secure pseudo-random generator methods. |
Client and server scripts; server scripts support SuiteScript 2.1 only |
- |
|
Load the N/currency module to work with exchange rates within your NetSuite account. You can use this module to find the exchange rate between two currencies based on a certain date. |
Client and server scripts |
— |
|
Load the N/currentRecord module to access the record instance that you are currently working on. You can then use the record instance in a client context. |
Client scripts |
— |
|
Load the N/dataset module to create and manage datasets in SuiteAnalytics Workbook. Use this module with the N/workbook module to manage all aspects of your datasets and workbooks in SuiteAnalytics Workbook. |
Server scripts |
SuiteAnalytics Workbook |
|
Load the N/email module to send email messages from within NetSuite. You can use the email module to send regular, bulk, and campaign email. |
Client and server scripts |
— |
|
Load the N/encode module to convert a string to another type of encoding. See encode.Encoding for a list of supported character set encoding. |
Server scripts |
— |
|
Load the N/error module to create your own custom SuiteScript errors. Use these custom errors in try-catch statements to abort script execution. |
Server scripts |
— |
|
Load the N/file module to work with files in NetSuite. |
Server scripts |
— |
|
Load the N/format module to convert strings into a specified format and to parse formatted data into strings. |
Client and server scripts |
— |
|
Load the N/format/i18n module to format currency. |
Client and server scripts |
— |
|
Load the N/http module to make http calls. |
Client and server scripts |
— |
|
Load the N/https module to make https calls. You can also use this module to encode binary content or securely access a handle to the value in a NetSuite credential field. |
Client and server scripts |
— |
|
Load the N/clientCertificate module to send SSL requests with a digital certificate. |
Server scripts |
Certificate Access |
|
Load the N/keyControl module to access key storage. |
Server scripts |
Key Management |
|
Load the N/llm module to use generative artificial intelligence (AI) capabilities. You can use this module to send requests to the large language models (LLMs) supported by NetSuite and to receive LLM responses to use in your scripts. |
Server scripts SuiteScript 2.1 only |
— |
|
Load the N/log module to access methods for logging script execution details. Module members are also supported by the global log Object. |
Client and server scripts |
— |
|
Load the N/pgp module to send secure messages to one or multiple receivers. |
Server scripts SuiteScript 2.1 only |
— |
|
Load the N/piremoval module to remove personal information (PI) from system notes, workflow history, and specific field values. |
Server scripts |
Remove Personal Information Create Remove Personal Information Run |
|
Load the N/plugin module to load custom plug-in implementations. |
Server scripts |
— |
|
Load the N/portlet module to resize or refresh a form portlet. |
Client scripts |
— |
|
Load the N/query module to create and run searches using the SuiteAnalytics Workbook query process. |
Client and server scripts |
SuiteAnalytics Workbook |
|
Load the N/record module to work with NetSuite records. |
Client and server scripts |
— |
|
Load the N/recordContext module to get the context type of a record. |
Client and server scripts |
— |
|
Load the N/redirect module to redirect users to a URL, a Suitelet, a record, a task link, a saved search, or an unsaved search. |
Server scripts |
— |
|
Load the N/render module to create forms or email from templates and to print to PDF or HTML. |
Server scripts |
Advanced PDF/HTML Templates Custom PDF Layouts |
|
Load the N/runtime module to access runtime settings for company, script, session, system, user, or version. |
Client and server scripts |
|
|
Load the N/scriptTypes/restlet module to create custom handling for your RESTlet script. |
RESTlet scripts |
— |
|
Load the N/search module to create and run on-demand or saved searches and analyze and iterate through the search results. You can search for a single record by keywords, create saved searches, search for duplicate records, or return a set of records that match filters you define. |
Client and server scripts |
Perform Search Persist Search Publish Search |
|
Load the N/sftp module to connect to a remote FTP server using SFTP and transfer files. |
Server scripts |
Key Access (needed when public key authentication is used) |
|
Load the N/sso module to generate outbound single sign-on (SuiteSignOn) tokens. |
Client and server scripts |
— |
|
Load the N/suiteAppInfo module when you want to access information related to SuiteApps and Bundles. |
Client and server scripts |
— |
|
Load the N/task module to create tasks and place them in the internal NetSuite scheduling or task queue. Use this module to schedule scripts, run Map/Reduce scripts, import CSV files, merge duplicate records, and execute asynchronous workflows. |
Server scripts |
Tasks |
|
Load the task/accounting/recognition module to merge revenue arrangements or revenue elements. This module lets you combine revenue arrangements or revenue elements from multiple sources to represent a single contract for revenue allocation and recognition. |
Server scripts |
(Transactions) Revenue Arrangement |
|
Load the N/transaction module to void transactions. |
Client and server scripts |
— |
|
Load the N/translation module to load NetSuite Translation Collections in SuiteScript. |
Client and server scripts |
— |
|
Load the N/dialog module to create a modal dialog that is displayed until a button on the dialog is pressed. |
Client scripts |
— |
|
Load the N/message module to display a message at the top of the screen under the menu bar. |
Client scripts |
— |
|
Load the N/serverWidget module to work with the user interface within NetSuite. |
Server scripts |
— |
|
Load the N/url module to determine URL navigation paths within NetSuite or format URL strings. |
Client and server scripts |
— |
|
Load the N/util module to manually access util methods. Module members are also supported by the global util Object. |
Client and server scripts |
— |
|
Load the N/workbook module to create and manage workbooks in SuiteAnalytics Workbook. Use this module with the N/dataset module to manage all aspects of your datasets and workbooks in SuiteAnalytics Workbook. |
Server scripts |
SuiteAnalytics Workbook |
|
Load the N/workflow module to initiate new workflow instances or trigger existing workflow instances. |
Server scripts |
Workflow |
|
Load the N/xml module to validate, parse, read, and modify XML documents. |
Client and server scripts |
— |
|
* If you include a module in a script that is not a supported script type, an execution error will occur. This error may be UNEXPECTED_ERROR or INSUFFICIENT_PERMISSION or another error that indicates the method in the module could not be executed. |
— |