inventory item "quantityAvailable" does not appear...
# suitescript
k
inventory item "quantityAvailable" does not appear to always be present/valid? i have some items for example that instead seem to have a body field "price1quantity1". what's this mean, where do i find it in the docs? how do i reliably get the number of items available?
e
quantityavailable
is not a field on the Inventory Item record, so it is not accessible via the Record API. It is a Search Column in the Item table, so it is accessible via the Search API.
k
ah right, well that explains part 1
i am using searches, but i'm not getting values for some records
so i was trying to find out why
i was looking at these docs which google sent me to, and it's just not the same thing as the one you linked i assume
e
That link is: • for version 2016.2 • to the Schema Browser, which only applies to the SOAP API
😭 1
k
any idea why some would just be returning null? even though if i click view on the item it shows some data (in this case, 0) in the warehouse
e
ā¤ļø 1
k
(on hand, committed both = 5 here, for the only location)
e
I'm not sure why some would be null
k
might not actually be null - i'll have to redo my test with the search api
i'll follow up if i can't figure it out šŸ˜…
āœ… 1
Copy code
{internalid: Array(1), quantityAvailable: ''}
internalid: [{…}]
quantityAvailable: ""
from chrome console
it's just returning an empty string o_O
i guess it just reports 0 as an empty string for some awful reason
although this post is 4 years old, at least it confirms that this is expected rather than unexpected