I have created a saved search in NetSuite of type ...
# ask-stanley-ai
d
I have created a saved search in NetSuite of type Inventory Balance, which essentially aims to return, in a single list, all the serialsed and non-serialised stock available in a single location. I am trying to replicate my search in C#.net using the SOAP API, but I cannot find a search type for Inventory Balance, only Item, Inventory Detail, inventory numbers, etc. How can I replicate it?
c
AI generated answer (using internal Slack threads):
In order to replicate your Inventory Balance saved search in C#.net using the SOAP API, you would need to use the
ItemSearchBasic
and
InventoryNumberSearchBasic
search types. The
ItemSearchBasic
allows you to search for items, and you can filter by location to get the items available in a specific location. The
InventoryNumberSearchBasic
allows you to search for inventory numbers, which can be used to get serialized and non-serialized stock. Here is a rough example of how you might structure your search:
Copy code
csharp
ItemSearchBasic itemSearch = new ItemSearchBasic();
itemSearch.location = new SearchMultiSelectField();
itemSearch.location.operator = SearchMultiSelectFieldOperator.anyOf;
itemSearch.location.searchValue = new RecordRef[] { new RecordRef() { internalId = "your_location_id" } };

InventoryNumberSearchBasic inventorySearch = new InventoryNumberSearchBasic();
inventorySearch.item = new SearchMultiSelectField();
inventorySearch.item.operator = SearchMultiSelectFieldOperator.anyOf;
inventorySearch.item.searchValue = new RecordRef[] { new RecordRef() { internalId = "your_item_id" } };

SearchRequest request = new SearchRequest();
request.searchRecord = itemSearch;

SearchResponse response = _service.search(request);
Please replace
"your_location_id"
and
"your_item_id"
with your actual location and item IDs. Remember to handle the response properly and iterate over the result set to get your inventory balance. ****** 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.852713466
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851756632
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850909173
Please provide your feedback on this answer.
Thank you for your feedback
Thank you for your feedback