Discussions
SuiteWorld is the largest annual gathering of the NetSuite community! It will be held in Las Vegas on October 6-9, 2025. Our customers and partners look forward to SuiteWorld every year as a place to hear the latest from NetSuite, get hands-on learning, and connect with each other. Register now!
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!