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!
We apologize for any inconvenience this may cause and appreciate your understanding.
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);