Debugging Tips: SuiteScript for Scriptable Cart

  1. Use Incognito Mode for Development:
    • During development, open an incognito (private) session in your browser. Insert nlapiLogExecution functions into your code to visualize data flow and facilitate debugging. Remove these logs when done to avoid performance impact.
  2. Handling Catastrophic Errors:
    • If your script encounters critical errors, configured nlapiLogExecution calls can trigger emails to you or administrators. Configure recipients in the script record under the Unhandled Errors tab. Notifications activate only for unhandled exceptions.
  3. Notifications Configuration:
    • Define who receives notifications for catastrophic errors. Options include predefined roles or specific email addresses. Adjust these settings in the script record.
  4. Exceptions and Notification Details:
    • Learn more about how exceptions and notifications work in SuiteScript 1.0 Documentation. Understand scenarios triggering notifications, such as missing functions like customPageInit.
  5. Considerations During Debugging:
    • SuiteScript 2.0 user event scripts and client scripts cannot run simultaneously for Scriptable Cart. Typically, use SuiteScript 1.0 for user event scripts and SuiteScript 2.0 for client event scripts. Check SuiteScript for Scriptable Cart for details.
  6. Changes and Open Sessions:
    • Be aware that changes made during debugging may not reflect in open sessions or browsers immediately.

Leave a comment

Your email address will not be published. Required fields are marked *