Sunday, November 25, 2018

Sample code to add an Inventory Transfer record that contains Serialized Items in JAVA

 

Inventory Transfer has recently been supported in WSDL version 2011.2. The following code shows how to add Inventory Transfer record that contains Serialized Items.

InventoryTransfer invTransfer = new InventoryTransfer();

RecordRef postingPeriod = new RecordRef();
postingPeriod.setInternalId("53");
invTransfer.setPostingPeriod(postingPeriod);

RecordRef location = new RecordRef();
location.setInternalId("1");
invTransfer.setLocation(location);
  
RecordRef transferLocation = new RecordRef();
transferLocation.setInternalId("2");
invTransfer.setTransferLocation(transferLocation);
  
InventoryTransferInventory[] invTransferItem = new InventoryTransferInventory[1];
  
RecordRef item = new RecordRef();
item.setType(RecordType.serializedInventoryItem);
item.setInternalId("111");
  
invTransferItem[0] = new InventoryTransferInventory();
  
invTransferItem[0].setItem(item);
invTransferItem[0].setAdjustQtyBy(1.0);
invTransferItem[0].setSerialNumbers("SR100005");
  
InventoryTransferInventoryList invTransferList = new InventoryTransferInventoryList(invTransferItem,true);

invTransfer.setInventoryList(invTransferList);

WriteResponse writeRes = _port.add(invTransfer);

No comments:

Post a Comment