Discussions
New to NetSuite | Client Script: saveRecord(scriptContext)
After discussing all the types of SuiteScript in theNew to NetSuite | SuiteScript Types Overview article, we are now focusing on the different types ofClient Script. The saveRecord function is executed after the "Submit" button is pressed, but before the form is officially saved. It provides a last opportunity to validate or modify data, ensuring that specific conditions are met before the data is committed.
Here's a simple example of a saveRecord function:
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/error','N/currentRecord','N/ui/dialog'],
function(error,currentRecord,dialog) {
/**
* 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!
