Discussions
New to NetSuite | Client Script: pageInit(scriptContext)
After discussing all the types of SuiteScript in the New to NetSuite | SuiteScript Types Overview article, we are now focusing on the different types of Client Script. The pageInit function is triggered when a record is loaded, and its page is initialized in the browser. This function is typically used to set default values, initialize fields, or perform any other actions that should occur when the page is first loaded.
Here's a simple example of a pageInit function:
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/error','N/currentRecord'],
function(error,currentRecord) {
/**
* Function to be executed after page is initialized. Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced
----
- NetSuite Admin Corner | New to NetSuite
- Explore the NSC Webinars Category
- Join our poll and share your ideas! We want to know what you think. Don't forget to comment and make your voice heard!
