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.
quantityonhand
hi Ug,
Please can someone tell me what i'm not calling right in this script below?I want to get the quantityonhand of an item in a given location, using search.
Here's the script:
var loc=nlapiGetFieldValue('custrecord_locations');
var item=nlapiGetFieldValue('custrecord_items');
var filters = new Array();
filters[0] = new nlobjSearchFilter('internalid', null, 'equalTo', item);
filters[1] = new nlobjSearchFilter('inventorylocation', null, 'equalTo', loc);
var column= new nlobjSearchColumn('locationquantityonhand', loc)
var searchResults = nlapiSearchRecord('inventoryitem',null,filters,column);
var onHand = searchResults[0].getValue('locationquantityonhand', loc,'sum');.........................
the itemid and locationid are sourced from a customrecord and used in performing the search.I can't figure out what's wrong because the script isn't running the search.Any suggestion on this or any other way to get the 'quantityonhand' for an inventoryitem would be helpful.
0