The code below is a sample Java code to call an InventoryDetailSearchBasic. Note that this web service operation cannot be used as stand alone search.
public void testItemSearchByBin() throws Exception{
c = new NLWsClient(CRED_DEV_ALL_FEAT, 8888, "http://localhost");
c.useRequestLevelCredentials();
c.setPrefIgnoreReadonly(true);
// criteria - find all items by bin
SearchMultiSelectField binNumber = new SearchMultiSelectField();
binNumber.setOperator(SearchMultiSelectFieldOperator.anyOf);
// specify bin number with internal ID
binNumber.setSearchValue(new RecordRef[]{mrr("1", RecordType.bin)});
InventoryDetailSearchBasic inventoryDetailSearchBasic = new InventoryDetailSearchBasic();
inventoryDetailSearchBasic.setBinNumber(binNumber);
ItemSearch itemSearch = new ItemSearch();
itemSearch.setInventoryDetailJoin(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.setInventoryNumber(new SearchColumnSelectField[]{new SearchColumnSelectField()});
columns.setInventoryDetailJoin(idsrb);
ItemSearchAdvanced isa = new ItemSearchAdvanced();
isa.setCriteria(itemSearch);
isa.setColumns(columns);
c.search(isa);
}
Hey to everyone, it’s my first visit of the blog site; this blog includes awesome and actually best info for the visitors.
ReplyDeleteUX agency