Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
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);