Suitescripts can be debugged using the suitescript debugger.
To use the NetSuite debugger login to NetSuite system and navigate to Customization > Scripts > Script Debugger.
(or)
Sandbox : debugger.sandbox.netsuite.com
Production : debugger.netsuite.com
Choose “Debug Existing” to debug the deployed script. This will only show those scripts that are in Testing Mode. After choosing the script to debug, the respective record/form is to be applied with any event either save, edit and the debugger will hit on the respective function on the code.
Debugging a client script is quite simple. Using the keyword “debugger;“ in the script it can be easily debugged in the browser debugger itself and any errors/warning can be identified.
For Server Scripts like Scheduled Script, User Event Script, Portlet etc., it is necessary to use NetSuite debugger to debug it.
Deploying a Script for Debugging in NS Debugger
1. Navigating to Debugger
2.Choosing a Script to Debug
Now the script is loaded to the SuiteScript debugger. The respective operation can be done on record and the script can be debugged.
For Example : If a user event script deployed on sales order object is to be debugged for its before submit event. Follow the below steps.
- Open Script Debugger
- Select the script to debug
- Open the Sales Order form
- Click “Save” button in Sales Order
- Now debugger will hit on the Before Submit Even function. Use the respective controls to debug the script.
Controls in Debugger
Debug Script – This allows to write a script in debugger script editor and to debug the script.
Choose Existing – This allows to debug the already deployed script of any type. The scripts that are in Testing Status will be shown for debugging. Scripts that are in Release mode cannot be debugged.
Leave a comment