Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Problems when passing Record object as script parameter
I can't seem to get the actual data in a record object.
From User Event script:
var newrecord = nlapiGetNewRecord();
var oldrecord = nlapiGetOldRecord();
var params = {};
params.custscript_newrecord = newrecord;
params.custscript_oldrecord = oldrecord;
nlapiScheduleScript('customscript_sc_scriptid', 'customdeploy_sc_deployid', params);
....
In Scheduled Script:
var newrecord= nlapiGetContext().getSetting('SCRIPT', 'custscript_newrecord');
var oldrecord = nlapiGetContext().getSetting('SCRIPT', 'custscript_oldrecord');
var newrecord_itemcount= newrecord.getLineItemCount('item'); -----> I get an error here that says "Cannot find function getLineItemCount in object nlobjRecord"
I have already tried doing JSON.stringify and JSON.parse but it's also not working.
Any help is greatly appreciated.
Thanks!