Get available physical quantity

Without joining the InventSum table you can easily get the available quantity for an item:

Qty qty = WHSInventOnHand::getPhysicalAvailQty(itemId, inventDim);

The parameters for the methods are just the relevants.

  • ItemId
  • Find or create the inventDim for the inventory dimension. If you need to check the quantity on different licenseplates (f.E.) you have to loop through the InventDims:
InventDim inventDim;

while select inventDim
     where inventDim.inventSiteId == "myInventSite"
           && inventDim.InventLocationId == "myInventLocation"
           && inventDim.LicensePlateId != ""
     qty = WHSInventOnHand::getPhysicalAvailQty(itemId, inventDim, true, true);
     if (qty >= qtyNeeded)
          return inventDim.InventDimId;

Leave a Comment