item search when inventory location filter is adde...
# ask-stanley-ai
h
item search when inventory location filter is added gives an error and doesn't allow filtering by that location
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like the error you're encountering when trying to filter by inventory location in an item search might be due to the way you're setting up your search criteria. In NetSuite, all joins in searches are left outer joins. This means that you get a response for all locations for all location on hand fields. To filter your results down appropriately, you need to use a location on hand criteria. There is a field called
Location On Hand
that gives you the location on hand for a location. Everything you see in that location table at the bottom of the item record that is retrievable is like
Location On Hand
or
Location Available
, etc. If you have many locations, you will see a line for each location. You can restrict this by adding
Inventory Location
to your criteria. Here's a sample filter expression you might use:
Copy code
["inventorynumber.internalid","anyof",serialID],"AND", ["location.internalid","anyof",locationID]
Remember, it's always a good idea to build the search in the UI first, load it in code, then log its filter expression. This can help you avoid guessing what the filters need to be and ensure you're setting up your search correctly. ****** 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.834484458
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82940346
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823211551
Please provide your feedback on this answer.