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 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Saved Search Filter in SuiteScript
I am trying to pull the quantity billed for an item, based on a UI-created saved search that pulls in sales orders for all items. Having difficulty with passing the item to filter by on to the search in SS. My first attempt at doing so, so I am hoping I am missing something simple.
function afterSubmit(type)
{
if (type == 'edit');
var results = nlapiSearchRecord('salesorder','customsearch109', new nlobjSearchFilter('item',null,'is','01839 Test'));
var mtd = 0;
for(var i = 0; results != null && i < results.length; i++)
{
var val = results[i].getValue('quantitybilled');
mtd = parseFloat(mtd) + parseFloat(val);
}
nlapiSetFieldValue('custitem_mtd',mtd);
0