I'd like to query something like this 'SELECT * FR...
# ask-stanley-ai
a
I'd like to query something like this 'SELECT * FROM inventorybalance ib WHERE ib.location = ? AND ib.item = ? AND ib.inventorystatus = 1', however I'd like to know the quantity available in a specific date I got this error some days ago: You only have 4 available. Please enter a different quantity."
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you can get the available quantity for an item at a specific location by status using a saved search in the UI. You can build the search in the UI first, load it in code, and then log its filter expression. The filters could be something like
[\"inventorynumber.internalid\",\"anyof\",serialID],\"AND\", [\"location.internalid\",\"anyof\",locationID]
. However, getting the available quantity at a historical date seems to be a challenge. The inventory valuation report can provide the on-hand quantity from historical dates, but not the available quantity. One suggestion was to use the NetSuite Analytics Warehouse (NSAW) for inventory snapshots, but it's unclear if this would provide the available quantity at a historical date. Another suggestion was to create a saved search to sum all transaction lines. For getting the available quantity of a line item in a sales order based on their inventory location, you can use the "Location On Hand" field in a saved search. ****** 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.861267149
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858947754
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858398438
Please provide your feedback on this answer.