What You Can Do with the SuiteScript API
SuiteScript is a JavaScript-based API that provides the ability to extend NetSuite beyond its standard capabilities and additional capabilities provided through point-and-click customization.
You can access most NetSuite forms, records, and customization objects through SuiteScript. What you decide to do with SuiteScript depends on which part of NetSuite you're trying to extend, search, or process.
Before using SuiteScript, consider what you want to achieve in NetSuite:
What You Want to Do
The following table shows some of SuiteScript uses. Links are provided to the NetSuite script type you can use to programmatically accomplish the tasks.
Task |
Suggested NetSuite Script Type |
---|---|
Perform custom business processing when NetSuite records are updated, created, or deleted |
|
Perform custom validations and calculations in the browser |
|
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 |
|
Execute NetSuite searches |
SuiteScript 2.x User Event Script Type or SuiteScript 2.x Scheduled Script Type |
Perform 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 |
|
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 2.x 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
There are two ways to run SuiteScript scripts:
-
The SuiteCloud Development Framework (SDF) — Using SDF with the SuiteCloud Software Developer Kit (SDK) is the best solution for creating a script as a part of an overall NetSuite customized solution packaged with other items, such as custom records, custom forms, other scripts, or more. For more information about SDF, see SuiteCloud Development Framework.
-
The NetSuite UI — You can manually upload your script file, create a script record, and deploy the script.
To upload and deploy a script in the NetSuite UI:
-
Write and save your script as a JavaScript file.
-
Upload the JavaScript file to NetSuite.
-
Create a script record for your script.
-
Create a script deployment record to define script runtime options and deploy the script.
To learn about each step in the above process, see SuiteScript 2.x API Introduction. This topic includes information about script basics, the script creation process, and a sample Hello World! script.