Debugging Overview

This overview section introduces:

Note:

To use the Script Debugger and the 2.1 Script Debugger, you must be using a role with SuiteScript permission (Full level).

Debugging Modes

The Script Debugger and the 2.1 Script Debugger both provide two debugging modes:

The Debugger Domain

It is important to be aware that when you debug any version of SuiteScript scripts, you are operating in a separate Debugger domain.

Important:

Any changes you make to your account when on this Debugger domain will affect the data in your production account. For example, if you execute a script in the Debugger that creates a new record, that record will appear in your production account.

Note:

You may experience a decrease in performance when working on Debugger domains.

To access the debugger, go to Customization > Scripting > Script Debugger. The Debugger domain is available from a production account or a release preview account. If you are already logged in to your NetSuite account, you will not need to enter you account information again to access the Debugger domain.

When you are logged in to the Debugger domain, you will see the Debugger logo at the top of the page:

The Debugger domain indicator.

When you are in the Debugger domain, you can debug SuiteScript 1.0, SuiteScript 2.0, and SuiteScript 2.1 scripts if the following requirements are met:

  • You must have scripting permission. See Setting Roles and Permissions for SuiteScript for more information.

  • You must be the assigned owner of the script (as indicated on the script record).

  • If you are debugging a script that already has a defined script deployment, the script must be in Testing mode before it can be loaded into the debugger. If you want to debug a script that has already been released into production, you must change the script's status from Released to Testing on the Script Deployment page. See Setting Script Deployment Status for more information about the script deployment status.

Client scripts can be debugged using the tools available in your browser. Both form-level and record-level client scripts should be tested on the form/record they run against.

If a bundled script has been installed into your account and the script has been marked as hidden, you will not be able to debug this script.

Be aware that the Script Debugger and the 2.1 Script Debugger are not any of the following:

  • API test consoles

  • Integrated development environments (IDE)

  • Script deployment interfaces. To deploy a script to NetSuite, you must still create a script record and define the script's deployment parameters on the Script Deployment page.

  • Script runner interfaces (for example, scheduled scripts still need to be placed INQUEUE for task completion)

Terms Related to Debugging

You may find it useful to learn the following terms related to debugging SuiteScript scripts:

Term

Definition

Call Stack

A stack (most recent on top) of all the active functions (and their local variables) called up until the current line of execution.

JavaScript Debugging Pane

The pane, normally on the right side of the Chrome DevTools tab (opened for SuiteScript 2.1 debugging), which displays breakpoints, watches, variables, and the call stack, and includes execution control buttons.

Line Break Point

A user-selected line in source code where program halts execution.

Minify/de-minify

Minified code has had white space and other characters removed from display, so the entire script appears as one long line. This can occur when using the 2.1 Script Debugger. Minified code can be de-minified from within the Debugger. See Using Chrome DevTools.

User Event Break Point

A user event script where program execution should be paused. The user event must be invoked during script execution for the break point to function.

Watch

A variable or expression that is monitored throughout the program's execution in the current scope.

Related Topics

SuiteScript Debugger
Debugging SuiteScript 1.0 and SuiteScript 2.0 Scripts
Debugging SuiteScript 2.1 Scripts
Debugging Client Scripts
Script Debugger Metering and Permissions

General Notices