Here is the list of the questions sent out during the webinar and the answers that were provided.
Name some best practices to achieve scalable customizations.
It is better to check governance units when running your SuiteScript customizations. Also, make use of the retry mechanism along with try-catch blocks in your scripts to get more information about the errors you get.
For User Event scripts that touch multiple records, is it better to have a script per record type or a single script that handles logic based on record type?
It is generally best practice to have a separate User Event script for each record type so you can easily check each of the logs. You may also want to utilize a library to encapsulate any common logic, then import those libraries into each record type per script.
Where can I access SuiteScript Data Validator?
The SuiteScript Data Validator is a tool that can be used to create documentation for scripts, custom modules, and SuiteApps. It includes several custom tags, such as @NApiVersion and @NScriptType , which are required in each entry point script uploaded to NetSuite.
The data validator is available for SuiteScript 2.x and is used to validate the SuiteScript version. It includes APIs for SuiteCloud Developer.
Reference: SuiteScript 2.x JSDoc Validation
What is the best way to handle governance in Map/Reduce scripts?
The best way to handle governance in map/reduce scripts in NetSuite is to design each stage so that it efficiently uses governance points and relies on the built-in automatic yielding of map/reduce scripts, while keeping processing logic concise within each stage (Map, Reduce, Summarize). You should split tasks into smaller units of work where possible, avoid unnecessary record loads or saves, use batch processing techniques, and leverage the context isRest should split tasks into smaller units of work where possible, avoid unnecessary record loads or saves, use batch processing techniques, and leverage the context isRestarted property to manage resumptions after yielding. Also, make sure to monitor script governance usage in logs to identify and refactor any processes consuming excessive resources, ensuring optimal performance and avoiding unexpected execution terminations.
For the recap question, why is the answer SuiteScript Data Validator when we just covered SuiteScript Debugger? What is the SuiteScript Data Validator?
The SuiteScript Data Validator can be accessed through the SuiteScript Debugger in NetSuite. It is used to validate data inputs and interactions with the NetSuite platform, helping you test and debug scripts in real-time.
What are the recommendations when a SuiteScript owner has retired and no longer has the Access box checked on the Employee page?
You can normally change the owner of a script through the script record (via the Owner drop-down). However, NetSuite-provisioned SuiteScripts are locked, so the drop-down isn’t accessible.
If the script is from a bundle, the best way to change the owner is by contacting the owner of the bundle.
My company has old scripts locked by previous administrators. Is there any way of unlocking them, or should I deactivate and create new ones?
Unfortunately, it’s not possible to unlock or modify locked scripts in NetSuite. Locked scripts are typically protected to maintain integrity and prevent accidental changes.
The best approach is to deactivate those scripts and create new ones to achieve the needed functionality.
If I throw the error object inside the catch block in a loop, will it stop script execution?
Throwing an error object inside a catch block will not automatically stop script execution unless you explicitly handle it that way.
What is the best way to test automated invoice scripts?
The best approaches are:
- User Event Script (UE): For immediate invoice creation after a triggering record is saved (e.g., Sales Order approval).
- Scheduled Script: For batching invoices and creating them on a schedule.
- Map/Reduce Script: For handling multiple invoices at once.
Tips:
- Always add error handling/logging (try/catch).
- Test in sandbox with different Sales Order statuses and edge cases (partial billing, multiple fulfillments, etc.).
- If invoices shouldn’t always auto-generate, add a custom checkbox (e.g., “Auto Invoice”) to control behavior.
What makes SuiteScript Debugger unique compared to other environments?
SuiteScript Debugger is the first real-time, web-based interactive debugger that allows code validation and testing as third-party applications run on the application server.
Unlike traditional SaaS development environments that test only on client machines, SuiteScript Debugger enables testing directly in a live server environment against live data. This helps developers see and correct behavior exhibited by their applications more accurately.
Thank you for joining us. You can watch the full session here: Webinar Replay: Top Tips for IT Pros Using NetSuite