NetSuite is a cloud-based ERP, CRM, E-Commerce, and Professional Services management platform. It is used by over 30,000 companies to run their entire business.
NetSuite is fully customizable by administrators and developers, including via a JavaScript-based API called SuiteScript. Developers are able to write scripts that are triggered by various events throughout the NetSuite system to automate business processes.
| Version | Release Date |
|---|---|
| 2016.2 | 2016-09-20 |
Create a new JavaScript file using your favorite editor or IDE
Add the following source code to your file (original source here)
/**
* A simple "Hello, World!" example of a Client Script. Uses the `pageInit`
* event to write a message to the console log.
*/
function pageInit(type) {
console.log("Hello, World from a 1.0 Client Script!");
}
Save the file as hello-world.js wherever you wish
hello-world.js as the Script FilepageInit in our source file to the Page Init script event by entering pageInit in the Page Init Function fieldCreate a new JavaScript file using your favorite editor or IDE
Add the following source code to your file (original source here)
define([], function () {
/**
* A simple "Hello, World!" example of a Client Script. Uses the `pageInit`
* event to write a message to the console log.
*
* @NApiVersion 2.x
* @NModuleScope Public
* @NScriptType ClientScript
*/
var exports = {};
function pageInit(context) {
console.log("Hello, World from a 2.0 Client Script!");
}
exports.pageInit = pageInit;
return exports;
});
Save the file as hello-world2.js wherever you wish
hello-world2.js as the Script File