Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 18, 2026, at 8:00 PM Pacific Time, our Case Management System will undergo a scheduled maintenance for approximately 15 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Scheduled script fails to load Item Record ..
Hi,
I have a Scheduled script that updates certain fields of the Item Record.The script has a search function which search for items.
var searchResultArr = nlapiSearchRecord('item', null, filtersArr, cols);
It succeeds in searching the items..but the script fails when it reaches the line
record = nlapiLoadRecord('item', itemIntId);
Any ideas??
//for (var i = 0; searchResultArr != null && i < searchResultArr.length ; i++) for (var i = 0; i < 1 ; i++) { itemRecord = searchResultArr[i]; manuText = itemRecord.getValue('custitem_manufacturer_text'); deptText = itemRecord.getValue('custitem_system_text'); categoryText = itemRecord.getValue('custitem_category_text'); itemName = itemRecord.getValue('name'); itemIntId = itemRecord.getValue('internalid'); nlapiSendEmail(-5, '43486', 'Infra :Item before update ',emailMsg, null, null, null); //load the record record = nlapiLoadRecord('item', itemIntId); //set the Department,DNet Manufacturer & DNet Category fields record.setFieldValue('custitem_manufacturer', manuText); record.setFieldValue('department', deptText); record.setFieldValue('custitem_category', categoryText); nlapiSubmitRecord(record, false); record = null; emailMsg = emailMsg + "n" +i +":"+ itemName ; } 0