NETSUITE TUTORIALS

netsuite tips & tricks

How to Debug Scripts in NetSuite

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
^FFA69ECDFE97C03AAD04CC7A6B3E33F6947BB49CEE7E2C7CF8^pimgpsh_fullsize_distr

1. Navigating to Debugger
^A01EB66FBDEA6D30632BC4A8D3A7E682C70F67BAF5A2F63F43^pimgpsh_fullsize_distr

 

2.Choosing a Script to Debug
^C48A35B484E5BFD876B7572DB2D5D28680C98CE0033FDFBCD6^pimgpsh_fullsize_distr

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.

  1. Open Script Debugger
  2. Select the script to debug
  3. Open the Sales Order form
  4. Click “Save” button in Sales Order
  5. 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.

 

 

Published by

2 responses to “How to Debug Scripts in NetSuite”

  1. I’ve been browsing online more than 3 hours lately, but I never
    discovered any attention-grabbing article like yours.
    It’s lovely value enough for me. In my view,
    if all webmasters and bloggers made excellent content as you did,
    the web can be a lot more helpful than ever before.

    Like

Leave a comment