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:
What You Want to Do
The following table shows some of the uses for SuiteScript along with a 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 |
|
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 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 |
|
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:
-
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 factors, 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
To upload and deploy a script in the NetSuite UI:
-
Write your script in your code editor, and save it 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 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.