suiteql get inventory on hand in base unit
# ask-stanley-ai
c
suiteql get inventory on hand in base unit
c
AI generated answer (using internal Slack threads):
To get the inventory on hand in base unit using SuiteQL, you can use the
INVENTORYITEM
table which contains the
BASEUNIT
field. However, the quantity on hand is not directly available in this table. For the quantity on hand, you would need to use the
INVENTORYNUMBERBIN
table which contains the
ONHAND
field. This field represents the quantity on hand for a specific inventory item in a specific bin. You would need to join these two tables on the
INVENTORYITEM
field to get the quantity on hand in the base unit for each inventory item. Here is a sample SuiteQL query:
Copy code
sql
SELECT 
    INVENTORYITEM.ITEMNAME, 
    INVENTORYITEM.BASEUNIT, 
    SUM(INVENTORYNUMBERBIN.ONHAND) AS TOTAL_ONHAND
FROM 
    INVENTORYITEM 
JOIN 
    INVENTORYNUMBERBIN 
ON 
    INVENTORYITEM.ITEMNAME = INVENTORYNUMBERBIN.ITEMNAME
GROUP BY 
    INVENTORYITEM.ITEMNAME, 
    INVENTORYITEM.BASEUNIT
This query will return the item name, the base unit, and the total quantity on hand for each inventory item. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823659897
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818264961
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816015542
Please provide your feedback on this answer.