SuiteScript 2.0 Tutorial - Debugging Client Script Using Debugging Tools on your Browser | NetSuite
Important: To debug a client script, the script MUST include a ‘debugger;’ statement. Place the ‘debugger;’ statement near the top of the script so that the debugger is invoked immediately when the script is triggered. Execution will stop when the statement is reached, allowing you to examine script properties and variables using the debugging tools in your browser.
To debug a SuiteScript client script:
Create, upload and deploy your client script.
Get ready to perform the action to trigger your client script. For example, if your client script trigger (entry point) is saveRecord on the Purchase Order record, open a new purchase order in NetSuite, enter your data, but do not click Save.
Access the debugger in your browser (before triggering the script):
Enter CTRL+SHIFT+I in Chrome
Enter CTRL+SHIFT+I in Firefox
Enter CTRL+OPTION+I in Safari
Note: If you access the browser debugger before you are ready to trigger your script, the debugger may pause at every action you perform in the browser causing unnecessary and premature interaction with the debugger.
When the debugger is open, click Save on the purchase order (in this example). The debugger will pause the execution of your script at the location of the ‘ debugger;‘ statement. You can now use the debugger tools in your browser to step through the code, look at values, set breakpoints, etc. Refer to the documentation for your browser for more information.
When debugging client scripts, some scripts might be minified. Minified scripts have all unnecessary characters removed, including white space and new line characters. You can use your browser debug tools to de-minify the script. This is typically done using the { } button. See the documentation for your browser for more information.
When you are done using the debugger, it can be closed. Your NetSuite page will remain displayed and you can continue using NetSuite.
Client scripts are executed on the client browser based on how they are deployed. To debug a client script, use the debugging tools available on your browser. SuiteScript supports several browsers:
Google Chrome (preferred)
Mozilla Firefox (preferred)
Microsoft Edge
Apple Safari
Each browser includes its own debugging tools. The following table includes links to documentation for each browser.
Browsers and Documentation Link
Google Chrome
https://developers.google.com/web/too...
Mozilla Firefox
https://developer.mozilla.org/en-US/d...
Microsoft Edge
https://docs.microsoft.com/en-us/micr...
Apple Safari
https://developer.apple.com/library/a... and https://support.apple.com/guide/safar...
⏱️⏱️VIDEO CHAPTERS⏱️⏱️
00:00 - Intro
00:12 - Developer Tools
00:50 - Client Script PageInit - debugger keyword
01:35 - Script Record and Deployment
01:54 - Client Script PageInit using Browser tools
02:42 - Breakpoints
03:38 - Watch
04:50 - Resume
06:00 - Step
07:00 - Step Over
09:00 - Step Into and Step Out
10:15 - Deactivate Breakpoints
#suitescript #netsuiteclientscript #suitescript2.0 #clientscript #writesuitescriptusingchatgpt #netsuiteclientscriptpageinit #suitescript2.1 #netsuitesuitescripttutorial #suitescript1.0 #suitescriptclientscript #clientsidescript #netsuiteclientscriptfieldchange #netsuiteclientscriptexample #netsuiteaddclientscript #debuggingclientscriptsuitescriptbrowsertools #chromedevelopertools #javascriptdebugging #debuggingjavascriptinchromedevtools
Auf dieser Seite können Sie das Online-Video SuiteScript Tutorial - Debugging Client Script Using Debugging Tools on your Browser | NetSuite mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Sweet Scripts Studios 19 Juli 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,070 Mal angesehen und es wurde von 27 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!