Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Help with script
Hi,
Can anyone tell me what I am doing wrong with the following script:
var newRecord = nlapiGetNewRecord();
var filters = new Array();
for ( i = 1 ; i <= newRecord.getLineItemCount('item'); i++ ) {
var itemID = newRecord.getLineItemValue('item','item',i);
filters[0] = new nlobjSearchFilter('internalid',null,'equalTo',itemID,null);
var columns = new Array();
columns[0] = new nlobjSearchColumn('displayname');
columns[1] = new nlobjSearchColumn('featureddescription');
var searchresults = nlapiSearchRecord('inventoryitem',null,filters,columns);
var item_name = searchresults[0].getValue('displayname');
var description = searchresults[0].getValue('featureddescription');
var itemRecord = nlapiLoadRecord('inventoryitem',itemID);
nlapiLogExecutionNote('DEBUG','itemID='+itemID);
nlapiLogExecutionNote('DEBUG','itemRecord='+itemRecord);
nlapiLogExecutionNote('DEBUG','itemName='+item_name);
nlapiLogExecutionNote('DEBUG','description='+description);