Tips for Debugging SuiteScript 2.1 Scripts
Only SuiteScript 2.1 scripts can be debugged using the 2.1 Script Debugger. You cannot use the 2.1 Script Debugger to debug SuiteScript 1.0 or SuiteScript 2.0 scripts.
The following tips may help you debug SuiteScript 2.1 scripts using the Chrome DevTools debugger:
-
If your script code appears minified (lacking white space and new line characters), you can use the de-minify button.
to change the display of the code so that it is readable.
-
Details normally displayed on the Execution Log of the Script Debugger page are shown on the Chrome DevTools console when debugging SuiteScript 2.1 scripts.
-
Execution metrics for SuiteScript 2.1 scripts are shown in the Chrome DevTools console when the script completes execution. These are general the same metrics displayed for SuiteScript 1.0 and SuiteScript 2.0 scripts in the Script Debugger page and include script messages and alerts, including script errors.
-
Use breakpoints to pause script execution at predetermined lines of code. Active breakpoints are listed in the Breakpoints List in the JavaScript debugging pane (on the Chrome DevTools tab).
-
Use the Watch window on the JavaScript debugging pane to see values of variables within your script and to evaluate expressions on-the-fly.
-
Use the Call Stack window on the JavaScript debugging pane to view different areas of your script. You can also select a point in the call stack and resume execution from that point.
-
To cancel a debugging session without completing script execution, click the X button on the Script Debugger page. The Chrome DevTools tab can be left opened or it can be closed. If you leave it open, it will be used for the next debugging session. Note that simply closing the tab does not fully cancel the current debugging session. You must use the red X button.
-
Each 2.1 debugging session has a timeout. If you do not perform any actions in the Chrome DevTools debugger within the timeout period, your debug session will end. See Idle Timeouts.