KM
04/23/2026, 12:33 PMCeligo AI
04/23/2026, 12:33 PMAI generated answer (using internal Slack threads):To return the current inventory (items / inventory detail) for a location using SuiteScript, you can create a search on the Inventory Balance record. Here is a sample code snippet based on the conversations:
javascript
var searchObj = search.create({
type: "inventorybalance",
filters:
[
["location","anyof",locationId],
"AND",
["item","anyof",itemId]
],
columns:
[
search.createColumn({name: "location", label: "Location"}),
search.createColumn({name: "item", label: "Item"}),
search.createColumn({name: "quantityonhand", label: "Quantity On Hand"})
]
});
var searchResultCount = searchObj.runPaged().count;
searchObj.run().each(function(result){
// .run().each has a limit of 4,000 results
return true;
});
In this code, replace locationId and itemId with the actual ID of the location and item you want to check. This search will return the location, item, and quantity on hand for the specified location and item.
Please note that the Inventory Balance record is a standalone search, so you need to specify the search type as a mandatory option.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/23/2026, 12:33 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840393186
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835083067
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83203125
Celigo AI
04/23/2026, 12:33 PMAbdul Basit
04/23/2026, 12:51 PM