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.
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);