Debugging the beforeLoad Entry Point Example

After you create the user event script and start the debugger, you debug the beforeLoad entry point. For more information, see Creating the User Event Script and Starting the Debugger Example.

To debug the beforeLoad entry point:

  1. Follow the steps above to create the user event script and start the debugger.

  2. To trigger the beforeLoad entry point, either create a new Customer or edit an existing Customer.

  3. When the customer record is loaded, a new Chrome DevTools tab opens in your browser showing your user event script ready to be debugged using the 2.1 Debugger:

    Chrome DevTools with script initially loaded and ready to be debugged.
  4. The execution of your script stops at the top of the script. You can now add breakpoints, watches, and so on, and begin debugging your script. You can also add a debugger; statement at the top of the beforeLoad entry point code to specifically stop the execution of the script at that entry point.

  5. When you have finished stepping over/playing through the last line of the beforeLoad entry point code, the Script Debugger tab will show:

    Script Debugger Completed Deployed Script Execution indicator for SuiteScript 2.1 script.

    And you will see a message in the Chrome DevTools tab that indicates the debugging connection was closed:

    Script Debugger Waiting for User Action indicator for SuiteScript 2.1 scripts.

    You don't need to click the Reconnect DevTools button on this message. If you want to reexecute the beforeLoad entry point in your script, save the Customer record to restart the debugging session.

Related Topics

General Notices