The code below is a sample C# code to call an InventoryDetailSearchBasic. Note that this web service operation cannot be used as stand alone search.
SearchMultiSelectField binNumber = new SearchMultiSelectField();
binNumber.@operator = SearchMultiSelectFieldOperator.anyOf;
binNumber.operatorSpecified = true;
RecordRef []bins= new RecordRef[1];
RecordRef binNo = new RecordRef();
binNo.internalId="5";
bins[0] = binNo;
binNumber.searchValue=bins;
InventoryDetailSearchBasic inventoryDetailSearchBasic = new InventoryDetailSearchBasic();
inventoryDetailSearchBasic.binNumber=binNumber;
ItemSearch itemSearch = new ItemSearch();
itemSearch.inventoryDetailJoin=inventoryDetailSearchBasic;
// columns - get only inventory detail info in result
ItemSearchRow columns = new ItemSearchRow();
InventoryDetailSearchRowBasic idsrb = new InventoryDetailSearchRowBasic();
// first three are commented, we want only Inventory number
//idsrb.setBinNumber(new SearchColumnSelectField[]{new SearchColumnSelectField()});
//idsrb.setInternalId(new SearchColumnSelectField[]{new SearchColumnSelectField()});
//idsrb.setQuantity(new SearchColumnDoubleField[]{new SearchColumnDoubleField()});
idsrb.inventoryNumber=new SearchColumnSelectField[] { new SearchColumnSelectField() };
columns.inventoryDetailJoin=idsrb;
ItemSearchAdvanced isa = new ItemSearchAdvanced();
isa.criteria=itemSearch;
isa.columns=columns;
SearchResult res = _service.search(isa);
No comments:
Post a Comment