Apparently I must be going about this problem the ...
# suitescript
d
Apparently I must be going about this problem the wrong way… what is the best method to get the inventory on hand by location in a subsidiary?
d
Make a search on item Record directly, you will get the Inventory location fields... options to filter out
d
yeah I am trying that but I am getting no values back for the on hand data
d
var itemSearchObj = search.create({ type: "item", filters: [ ["locationquantityavailable","greaterthan","0"], "AND", ["name","is","item"], "AND", ["inventorylocation.isinactive","is","F"] ], columns: [ search.createColumn({ name: "itemid", sort: search.Sort.ASC, label: "Name" }), search.createColumn({name: "inventorylocation", label: "Inventory Location"}), search.createColumn({name: "locationquantityavailable", label: "Location Available"}) ] }); var searchResultCount = itemSearchObj.runPaged().count; log.debug("itemSearchObj result count",searchResultCount); itemSearchObj.run().each(function(result){ // .run().each has a limit of 4,000 results return true; });
please have a look at this saved search
a
@D17339 Your search is looking at Inventory Quantity available, but @David Durst needs, Inventory on hand.
✔️ 1
@David Durst On Hand, Quantity Available have two levels details or info: 1- Global Values where On Hand = The Sum of All On Hand per location and the same for available. 2- Location On Hand where On Hand = Quantity On Hand for that specific location. So depending of your final goal and use case you may want to define an Inventory Location(which is different than Location) in your filters and then you Location On Hand in your results.