{"id":508,"date":"2021-07-15T08:35:12","date_gmt":"2021-07-15T08:35:12","guid":{"rendered":"https:\/\/www.saturotech.com\/blog\/?p=508"},"modified":"2024-03-18T19:36:22","modified_gmt":"2024-03-18T19:36:22","slug":"netsuite-client-script-2-0","status":"publish","type":"post","link":"https:\/\/saturotech.com\/blog\/netsuite-client-script-2-0\/","title":{"rendered":"NetSuite Client Script 2.0"},"content":{"rendered":"\n<p>Client Script is the script that runs on&nbsp;the user&#8217;s&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all others&nbsp;scripts types&nbsp;execute&nbsp;on the server-side of NetSuite. The primary use of&nbsp;this&nbsp;Script&nbsp;type&nbsp;is for responding to user interactions with records&nbsp;within the NetSuite UI. They can validate user-entered data and auto-populate fields or&nbsp;Sub lists&nbsp;at various form events. Scripts can be run on most standard records, custom record, and custom NetSuite pages&nbsp;like&nbsp;Suitelet.&nbsp;<\/p>\n\n\n\n<p><strong><strong>Functions<\/strong>\/trigger events of Client Script<\/strong>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg\" alt=\"\" class=\"wp-image-519\" srcset=\"https:\/\/saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg 1024w, https:\/\/saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-300x169.jpg 300w, https:\/\/saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-768x432.jpg 768w, https:\/\/saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1536x864.jpg 1536w, https:\/\/saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Following triggers can run a client script<\/strong>&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Loading a form for editing&nbsp;<\/li><li>Adding values or changing field&nbsp;(before and after it is entered)&nbsp;<\/li><li>Changing a&nbsp;field&nbsp;value&nbsp;that sources another field&nbsp;<\/li><li>Selecting a line item on a&nbsp;sub list&nbsp;<\/li><li>Adding a line item (before and after it is entered)&nbsp;<\/li><li>Saving a form&nbsp;<\/li><\/ul>\n\n\n\n<p><em>Client scripts are executed after any existing form-based clients, and before any user event scripts.<\/em>&nbsp;<\/p>\n\n\n\n<p><strong>Writing your first client script 2.0 code.<\/strong>&nbsp;<\/p>\n\n\n\n<p>define([&#8216;N\/ui\/dialog&#8217;],<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function (dialog) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function showAlertBox(context) {&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dialog.alert({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title: &#8216;I am an Alert&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;message: &#8216;Hello!&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>return {<\/p>\n\n\n\n<p>pageInit : showAlertBox<\/p>\n\n\n\n<p>});<\/p>\n\n\n\n<p><strong>define()<\/strong>\u202fFunction will load all the dependencies which the code is executing. For our code, we are using a dialog module. a dialog will provide a&nbsp;pop-up&nbsp;message on the browser screen.&nbsp;<br><strong>showAlertBox&nbsp;<\/strong>is a&nbsp;pageInit&nbsp;function and will get triggered when we load the page.&nbsp;<br><strong>dialog.alert<\/strong>\u202fwill give you one popup when the record loads because we are using&nbsp;pageInit&nbsp;function.&nbsp;<br><strong>return<\/strong>\u202fwell let NetSuite understand what triggers we are using in the program.&nbsp;<br>The above sample shows a client script applied to a sales order form.&nbsp;The script&nbsp;provides&nbsp;a pop-up to the user when the sales order&nbsp;page&nbsp;completes loading.&nbsp;<\/p>\n\n\n\n<p><strong>Client Scripts types with&nbsp;examples:<\/strong>&nbsp;<\/p>\n\n\n\n<p>\/**<\/p>\n\n\n\n<p>&nbsp;*@NApiVersion 2.x<\/p>\n\n\n\n<p>&nbsp;*@NScriptType ClientScript&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>&nbsp;*\/<\/p>\n\n\n\n<p>&nbsp;\/*<\/p>\n\n\n\n<p>&#8216;NApiVersion 2.x &amp; NScriptType ClientScript&#8217; this will help to netsuite to understand which script and version<\/p>\n\n\n\n<p>we are using where as in 1.0 we have to specify this manually by selection suitescript type and fucntions<\/p>\n\n\n\n<p>used in the script.<\/p>\n\n\n\n<p>&nbsp;*\/<\/p>\n\n\n\n<p>define([&#8216;N\/error&#8217;, &#8216;N\/ui\/dialog&#8217;, &#8216;N\/log&#8217;],<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function (error, dialog, log) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function pageInit(context) {&nbsp;&nbsp;&nbsp; \/\/ When the page loads this function will get triggred<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (context.mode !== &#8216;create&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dialog.alert({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title: &#8216;I am an Alert&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;message: &#8216;PageInit is Working.&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function validateField(context) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ Validate Field is matching our condition or not, save the field only if it matches our condition<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (context.fieldId == &#8216;custbody_phone&#8217;) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var phoneNo = currentRecord.getValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;custbody_phone&#8217;<\/p>\n\n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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function fieldChanged(context) { \/\/ check the item id and set value to memo body field \/\/return void<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var sublistNameSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var sublistFieldName = context.fieldId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var line = context.line;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (sublistNameSo === &#8216;item&#8217; &amp;&amp; sublistFieldName === &#8216;item&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentRecord.setValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;memo&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: &#8216;Item is : &#8216; + currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: &#8216;item&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;item&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) + &#8216; is selected&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function sublistChanged(context) { \/\/ this function is triggred when sublist is removed, inserted or edited<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var subNameValueOnSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var op = context.operation;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (subNameValueOnSo === &#8216;item&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentRecord.setValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;memo&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: &#8216;Sublist item Amount is &#8216; + currentRecord.getValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;total&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) + &#8216; and operation is: &#8216; + op<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function postSourcing(context) {&nbsp; \/\/ the function that is executed when a field that takes information from another field is modified.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var subNameValueOnSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var sublistFieldName = context.fieldId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var line = context.line;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (subNameValueOnSo === &#8216;item&#8217; &amp;&amp; sublistFieldName === &#8216;item&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: subNameValueOnSo,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: sublistFieldName<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) === &#8216;8235&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: subNameValueOnSo,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function lineInit(context) { \/\/same as pageInit, triggers when we select sublist\/\/return void<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var subNameValueOnSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (subNameValueOnSo === &#8216;partners&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentRecord.setValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;custbody_tracking&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: &#8216;partners&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;partner&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function validateInsert(context) { \/\/selects an existing line in a sublist and then clicks the Insert button<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var subNameValueOnSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (subNameValueOnSo === &#8216;partners&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: subNameValueOnSo,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function validateDelete(context) { \/\/ triggers if we remove sublist<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var subNameValueOnSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (subNameValueOnSo === &#8216;partners&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentRecord.setValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;custbody_additional_notes&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: subNameValueOnSo,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;partner&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) + &#8216; Removed&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function validateLine(context) { \/\/ Behave like a saveRecord in lineitem, if we save the sublist this function will get triggred<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var currentRecord = context.currentRecord;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var subNameValueOnSo = context.sublistId;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (subNameValueOnSo === &#8216;partners&#8217;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentRecord.setValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;custbody_new_partner&#8217;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: currentRecord.getCurrentSublistValue({<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistId: subNameValueOnSo,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldId: &#8216;partner&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}) + &#8216; Added&#8217;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;function saveRecord(context) {&nbsp; \/\/ When we save the record<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var options = {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title: &#8220;Confirmation&#8221;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;message: &#8220;Save this record&#8221;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dialog.confirm(options)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/* this will automatically let the NetSuite understand what function we are using in the code,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pageInit : anyFunctionName (and netsuite will understand this is pageInit Function) *\/<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pageInit: pageInit,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldChanged: fieldChanged,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postSourcing: postSourcing,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sublistChanged: sublistChanged,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lineInit: lineInit,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validateInsert: validateInsert,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validateField: validateField,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validateLine: validateLine,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validateDelete: validateDelete,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;saveRecord: saveRecord<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;};<\/p>\n\n\n\n<p>&nbsp; });<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>pageInit&nbsp;:&nbsp;This function will get triggered when the page is loaded.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>validateField&nbsp;:&nbsp;This function is executed when a field is changed. The simple example to use this function is by implementing on phone number field.&nbsp;<br>In&nbsp;the given&nbsp;example&nbsp;code&nbsp;trigger&nbsp;is set&nbsp;on body field \u2018Phone No\u2019 if the phone number is less than 9 then give the user a message using&nbsp;pageInit&nbsp;Function that \u2018Phone Number should be 9 digit long\u2019. This Field returns true or false&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>sublistChanged&nbsp;:&nbsp;This function is executed after a&nbsp;sublist&nbsp;has been inserted, removed, or edited. ex: If you&nbsp;insert&nbsp;item on sales order. In the above example if you add, remove or edit the operation well get displayed on memo field.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>postSourcing&nbsp;:&nbsp;This function is executed when a field that&nbsp;takes&nbsp;value&nbsp;from another field is modified.&nbsp;ex:&nbsp;If you have 2 field then one field can be modified by values of&nbsp;another&nbsp;field.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>lineInit&nbsp;:&nbsp;This is same as&nbsp;pageInit&nbsp;i.e&nbsp;it gets triggers when we click on line items. In the above example when you click on partner it will give you the internal id.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>validateInsert&nbsp;:&nbsp;This validation function is executed when a&nbsp;sublist&nbsp;line is inserted into an edit&nbsp;sublist. returns true\/false&nbsp;i.e&nbsp;if returns false then don\u2019t save&nbsp;sublist.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>validateDelete&nbsp;:&nbsp;When the&nbsp;sublist&nbsp;line is removed&nbsp;this type will get triggered.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\"><li>validateLine&nbsp;:&nbsp;When we save the record this function will get triggered.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"9\"><li>fieldChanged&nbsp;:&nbsp;This field will get triggered when a field is changed by the user. the&nbsp;fieldChange&nbsp;type returns void.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"10\"><li>saveRecord&nbsp;:&nbsp;This function well get executed when we save the record.&nbsp;<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>&nbsp;<\/td><td>For reference, comments are added in the scripts&nbsp;&nbsp;&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Follow the steps to use the above code:<\/strong>&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Copy the above code and save with .js&nbsp;extension.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Navigate to \u2013 customization &gt; Scripting &gt; Scripts &gt;new &amp; upload the file.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Deploy the script on&nbsp;&#8211;&nbsp;sales order. (You&nbsp;can deploy client script on any record).&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Now you can create a new sales order and practice.&nbsp;<\/li><\/ol>\n\n\n\n<p><strong>More About Client Script:<\/strong>&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Client Script cannot be debugged in NetSuite debugger.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Client script executes only on created, copied&nbsp;and edited records.&nbsp;If you want to run in other mode use user event Script.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>The governance limit of client script is 1000 units.&nbsp;<\/li><\/ol>\n\n\n\n<p><strong>Learn More: Client Script <\/strong>    &amp;  <strong> Client Script 2.0<\/strong><\/p>\n\n\n\n<p>To Know more about NetSuite Cloud ERP, feel free to reach us on&nbsp;<strong>Website:<\/strong>\u202f<a rel=\"noreferrer noopener\" href=\"http:\/\/saturotech.com\/\" target=\"_blank\">https:\/\/saturotech.com\/<\/a>&nbsp;&nbsp;<\/p>\n\n\n\n<p>Email ID: <a rel=\"noreferrer noopener\" href=\"mailto:info@saturotech.com\" target=\"_blank\"><a rel=\"noreferrer noopener\" href=\"mailto:info@saturotech.com\" target=\"_blank\">sales@saturotech.com<\/a><\/a><\/p>\n\n\n\n<p><strong>Contact No:<\/strong>&nbsp;+91 844-844-8939&nbsp;(&amp; Press 3)&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Client Script is the script that runs on&nbsp;the user&#8217;s&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all others&nbsp;scripts types&nbsp;execute&nbsp;on &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-508","post","type-post","status-publish","format-standard","hentry","category-cloud-computing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>NetSuite Client Script 2.0 | NetSuite Blog | Saturotech<\/title>\n<meta name=\"description\" content=\"Client Script is the script that runs on&nbsp;the user&#039;s&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NetSuite Client Script 2.0 | NetSuite Blog | Saturotech\" \/>\n<meta property=\"og:description\" content=\"Client Script is the script that runs on&nbsp;the user&#039;s&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/\" \/>\n<meta property=\"og:site_name\" content=\"NetSuite Blog | Saturotech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/saturotech\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-15T08:35:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-18T19:36:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/ccef02e83e22a41c4d0df8720fe7b70e\"},\"headline\":\"NetSuite Client Script 2.0\",\"datePublished\":\"2021-07-15T08:35:12+00:00\",\"dateModified\":\"2024-03-18T19:36:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/\"},\"wordCount\":3174,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/NetSuite-Client-Script-2.0-1024x576.jpg\",\"articleSection\":[\"Cloud Computing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/\",\"url\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/\",\"name\":\"NetSuite Client Script 2.0 | NetSuite Blog | Saturotech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/NetSuite-Client-Script-2.0-1024x576.jpg\",\"datePublished\":\"2021-07-15T08:35:12+00:00\",\"dateModified\":\"2024-03-18T19:36:22+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/ccef02e83e22a41c4d0df8720fe7b70e\"},\"description\":\"Client Script is the script that runs on&nbsp;the user's&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/NetSuite-Client-Script-2.0-1024x576.jpg\",\"contentUrl\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/NetSuite-Client-Script-2.0-1024x576.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.saturotech.com\\\/blog\\\/netsuite-client-script-2-0\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"NetSuite Client Script 2.0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/\",\"name\":\"NetSuite Blog | Saturotech\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/saturotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/ccef02e83e22a41c4d0df8720fe7b70e\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b574bd0e20944dbebcaded909cc2824ee60418212541e4eb26700e2728c65ff0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b574bd0e20944dbebcaded909cc2824ee60418212541e4eb26700e2728c65ff0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b574bd0e20944dbebcaded909cc2824ee60418212541e4eb26700e2728c65ff0?s=96&d=mm&r=g\",\"caption\":\"admin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NetSuite Client Script 2.0 | NetSuite Blog | Saturotech","description":"Client Script is the script that runs on&nbsp;the user's&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/","og_locale":"en_US","og_type":"article","og_title":"NetSuite Client Script 2.0 | NetSuite Blog | Saturotech","og_description":"Client Script is the script that runs on&nbsp;the user's&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all","og_url":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/","og_site_name":"NetSuite Blog | Saturotech","article_publisher":"https:\/\/www.facebook.com\/saturotech\/","article_published_time":"2021-07-15T08:35:12+00:00","article_modified_time":"2024-03-18T19:36:22+00:00","og_image":[{"url":"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#article","isPartOf":{"@id":"https:\/\/saturotech.com\/blog\/netsuite-client-script-2-0\/"},"author":{"name":"admin","@id":"https:\/\/saturotech.com\/blog\/#\/schema\/person\/ccef02e83e22a41c4d0df8720fe7b70e"},"headline":"NetSuite Client Script 2.0","datePublished":"2021-07-15T08:35:12+00:00","dateModified":"2024-03-18T19:36:22+00:00","mainEntityOfPage":{"@id":"https:\/\/saturotech.com\/blog\/netsuite-client-script-2-0\/"},"wordCount":3174,"commentCount":0,"image":{"@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#primaryimage"},"thumbnailUrl":"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg","articleSection":["Cloud Computing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/saturotech.com\/blog\/netsuite-client-script-2-0\/","url":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/","name":"NetSuite Client Script 2.0 | NetSuite Blog | Saturotech","isPartOf":{"@id":"https:\/\/saturotech.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#primaryimage"},"image":{"@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#primaryimage"},"thumbnailUrl":"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg","datePublished":"2021-07-15T08:35:12+00:00","dateModified":"2024-03-18T19:36:22+00:00","author":{"@id":"https:\/\/saturotech.com\/blog\/#\/schema\/person\/ccef02e83e22a41c4d0df8720fe7b70e"},"description":"Client Script is the script that runs on&nbsp;the user's&nbsp;browser.&nbsp;This is the&nbsp;only script that runs on the client-side, all","breadcrumb":{"@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#primaryimage","url":"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg","contentUrl":"https:\/\/www.saturotech.com\/blog\/wp-content\/uploads\/2021\/07\/NetSuite-Client-Script-2.0-1024x576.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.saturotech.com\/blog\/netsuite-client-script-2-0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/saturotech.com\/blog\/"},{"@type":"ListItem","position":2,"name":"NetSuite Client Script 2.0"}]},{"@type":"WebSite","@id":"https:\/\/saturotech.com\/blog\/#website","url":"https:\/\/saturotech.com\/blog\/","name":"NetSuite Blog | Saturotech","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/saturotech.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/saturotech.com\/blog\/#\/schema\/person\/ccef02e83e22a41c4d0df8720fe7b70e","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b574bd0e20944dbebcaded909cc2824ee60418212541e4eb26700e2728c65ff0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b574bd0e20944dbebcaded909cc2824ee60418212541e4eb26700e2728c65ff0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b574bd0e20944dbebcaded909cc2824ee60418212541e4eb26700e2728c65ff0?s=96&d=mm&r=g","caption":"admin"}}]}},"_links":{"self":[{"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/posts\/508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/comments?post=508"}],"version-history":[{"count":5,"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/posts\/508\/revisions"}],"predecessor-version":[{"id":1377,"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/posts\/508\/revisions\/1377"}],"wp:attachment":[{"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/media?parent=508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/categories?post=508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saturotech.com\/blog\/wp-json\/wp\/v2\/tags?post=508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}