Custom Coding

Customize the NetSuite UI and business logic through scripting.

SuiteScript

You can use the SuiteScript scripting language to extend NetSuite and customize, search for, and process your NetSuite data. SuiteScript enables full-featured application-level scripting capabilities that support sophisticated procedural logic on both the client and server sides. A SuiteScript Debugger is also available for debugging server scripts.

There are two versions of SuiteScript that you can use:

SuiteScript 2.0

SuiteScript 2.0 provides a modern API architecture that is familiar to JavaScript developers. The modularity of SuiteScript 2.0 supports encapsulation, provides intuitive code organization, and ensures there are no global variable or method naming conflicts. Automatic dependency management enables you to concentrate on logic instead of dependencies and load order. SuiteScript 2.0 is designed to support most standard JavaScript language features and gives you programmatic access to NetSuite functionality. For generic logic, you can use custom modules to load your preferred third-party JavaScript libraries.

SuiteScript 2.0 supports SFTP file transfer, data caching, search pagination, flat file streaming, and enhanced encryption, decryption, and hashing. SuiteScript 2.0 also provides asynchronous client side processing through promises, map/reduce scripts that provide a structured framework for server-side scripts processing a large number of records, and support for all HTTP content types.

To get started with SuiteScript, see SuiteScript 2.x API Introduction. For details about supported script types, see SuiteScript 2.x Script Types. For SuiteScript 2.0 API reference documentation, see SuiteScript 2.x Modules.

Note:

You cannot access all NetSuite fields and records using SuiteScript. The SuiteScript Records Browser and Records Catalog provide a summary of all records, fields, sublists, search joins, search filters, search columns, and record transformations that are supported in SuiteScript. For more information, see Working with the SuiteScript Records Browser and Records Catalog Overview.

SuiteScript 2.1

SuiteScript 2.1 is the latest version of SuiteScript. This version is based on the ECMAScript 2019 (ES2019) edition of the ECMAScript specification. It includes new language capabilities and functionality, and it supports all server script types (such as user event scripts, scheduled scripts, and Suitelets). SuiteScript 2.1 and future versions of SuiteScript will also support features planned for future editions of the ECMAScript specification using ES.Next. A dedicated debugger is also available to help you debug SuiteScript 2.1 scripts.

This latest version of SuiteScript is separate from previous SuiteScript versions (such as SuiteScript 2.0). You can create and run SuiteScript 2.1 scripts alongside SuiteScript 1.0 and SuiteScript 2.0 scripts in your account. Your existing scripts are not affected. You can use the @NApiVersion JSDoc tag and a value of 2.1 to specify that your script uses SuiteScript 2.1.

For more information about SuiteScript 2.1, see SuiteScript 2.1. For more information about debugging SuiteScript 2.1 scripts, see Debugging SuiteScript 2.1 Scripts.

SuiteCloud Development Framework

SuiteCloud Development Framework (SDF) is a development framework that can customize your NetSuite account from an integrated development environment (IDE) on your local computer. For more information about getting started with SDF, see Getting Started with SuiteCloud Development Framework.

SDF lets you create customizations and deploy SuiteCloud projects to your NetSuite accounts. These projects are file-based and use XML representations of NetSuite objects, such as custom record types, custom record instances, workflows, and other customizations. The SDF XML reference guide describes how to structure these XML files, and the fields that are available. For more information, see Customizations Supported by SuiteCloud Development Framework and the SuiteCloud Development Framework XML Reference.

SDF also supports inclusion of templates and SuiteScript files. You can build, validate, and deploy SuiteCloud projects locally using SDF. SDF improves code portability and provides a streamlined deployment process across various NetSuite account types.

While SDF provides developers with the benefits of using code to customize objects and deploy them to an account, distribution and object copying is also available.

  • To distribute a SuiteApp to accounts, see Distribution.

  • To copy a single custom record (including its dependencies) from one account to another account, see Copy to Account.

Related Topics

General Notices