What You Can Do with the SuiteScript API

SuiteScript is a JavaScript-based API that provides the ability to extend NetSuite beyond standard NetSuite capabilities and additional capabilities provided through point-and-click customization.

Most NetSuite forms, records, and customization objects and their event/trigger points are programmatically accessible through SuiteScript. What you decide to do with SuiteScript depends on which part of NetSuite you are trying to extend, search, or process.

When you think about using SuiteScript in NetSuite, you must ask yourself a few questions:

  1. What You Want to Do

  2. SuiteScript Modules That Support What You Want to Do

  3. How To Run a Script in NetSuite

What You Want to Do

The following table shows some of the uses for SuiteScript along with a l link to the NetSuite script type you might use to programmatically accomplish the tasks.

Task

Suggested NetSuite Script Type

Perform custom business processing when NetSuite records are updated, created, or deleted

SuiteScript 2.x User Event Script Type

Perform custom validations and calculations in the browser

SuiteScript 2.x Client Script Type

Create custom user interfaces

SuiteScript 2.x Suitelet Script Type or SuiteScript 2.x User Event Script Type and SuiteScript 2.x UI Modules

Run batch processes

SuiteScript 2.x Scheduled Script Type

Execute NetSuite searches

SuiteScript 2.x User Event Script Type or SuiteScript 2.x Scheduled Script Type

Perform various utility processing, such as sending email and faxes, creating and uploading files, or working with XML documents

SuiteScript 2.x Suitelet Script Type or SuiteScript 2.x User Event Script Type

Create custom dashboard portlets

SuiteScript 2.x Portlet Script Type

Perform processing in target accounts for packaged SuiteApps as part of SuiteApp installation or update

SuiteScript 2.x Bundle Installation Script Type and SuiteScript 2.x SDF Installation Script Type

SuiteScript Modules That Support What You Want to Do

The SuiteScript API documentation is organized by the types of tasks most developers want to perform. See SuiteScript 2.x API Reference to get started with the SuiteScript API.

See SuiteScript 2.x Modules to see how all the SuiteScript API is organized into modules. The documentation for each module lists whether it can be used in client, user event, scheduled, Suitelet, or portlets scripts.

How To Run a Script in NetSuite

You can run scripts you’ve written in SuiteScript in two ways:

To upload and deploy a script in the NetSuite UI:

  1. Write your script in your code editor, and save it as a JavaScript file.

  2. Upload the JavaScript file to NetSuite.

  3. Create a script record for your script.

  4. Create a script deployment record to define script runtime options and deploy the script.

To learn about each step in the process, see the SuiteScript 2.x API Introduction topic in the NetSuite Help Center. This topic includes information about script basics, the script creation process, and a sample Hello World! script.

Related Topics

General Notices