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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
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