Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Script Error: define is not defined
I have a script that extracts Expiration Date from Inventory Detail that is running successfully on a SandBox/Production account. I copied this script to another Sandbox account (Netsuite OneWorld) with the same settings. However, the execution logs show this error:
ReferenceError: "define" is not defined. (INVOCATION_WRAPPER#11)
In what situation keyword "define" is not recognized? Here is the script:
/**
* @NApiVersion 2.0
* @NScriptType ClientScript
*/
define(['N/record','N/search'], function(record,search) {
function saveRecord(context) {
var rec= context.currentRecord;
var customer = rec.getValue({fieldId : 'entity'});
setExpiryDate(rec);
log.debug(title+'setExpiryDate','completed');
return true
}
function setExpiryDate(rec){
var title = 'setExpiryDate()::';
0