How do I look up all inventory for a certain locat...
# ask-stanley-ai
a
How do I look up all inventory for a certain location
c
AI generated answer (using internal Slack threads):
To look up all inventory for a certain location in NetSuite, you can create a search on the item record and use filters to specify the location. Here is a sample SuiteScript code that demonstrates this:
Copy code
javascript
var itemSearchObj = search.create({
   type: "item",
   filters:
   [
      ["locationquantityavailable","greaterthan","0"],
      "AND",
      ["name","is","item"],
      "AND",
      ["inventorylocation.isinactive","is","F"]
   ],
   columns:
   [
      search.createColumn({
         name: "itemid",
         sort: search.Sort.ASC,
         label: "Name"
      }),
      search.createColumn({name: "inventorylocation", label: "Inventory Location"}),
      search.createColumn({name: "locationquantityavailable", label: "Location Available"})
   ]
});
var searchResultCount = itemSearchObj.runPaged().count;
log.debug("itemSearchObj result count",searchResultCount);
itemSearchObj.run().each(function(result){
   // .run().each has a limit of 4,000 results
   return true;
});
This script creates a search on the item record with filters for the location quantity available, the item name, and whether the inventory location is active. The columns returned in the search results include the item ID, the inventory location, and the location quantity available. Please note that the 'On Hand' and 'Quantity Available' fields have two levels of details or info: 1. Global Values where 'On Hand' = The Sum of All 'On Hand' per location and the same for available. 2. Location 'On Hand' where 'On Hand' = Quantity 'On Hand' for that specific location. Depending on your final goal and use case, you may want to define an Inventory Location (which is different than Location) in your filters and then your Location 'On Hand' in your results. ****** 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.84571147
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841998696
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841577649
Please provide your feedback on this answer.