Add an Inventory Transfer record via Web Services using C#

This code snippet shows how you can create an Inventory Transfer record via Web Services using C#. Take note that this is only exposed starting from the v2011.2 WSDL.

InventoryTransfer invTransfer = new InventoryTransfer();

RecordRef fromLoc = new RecordRef();

fromLoc.type = RecordType.location;

fromLoc.typeSpecified = true;

fromLoc.internalId = “1”;

RecordRef toLoc = new RecordRef();

toLoc.type = RecordType.location;

toLoc.typeSpecified = true;

toLoc.internalId = “2”;

InventoryTransferInventory[] invTransferItemArray = new InventoryTransferInventory[1];

RecordRef item = new RecordRef();

item.type = RecordType.inventoryItem;

item.typeSpecified = true;

item.internalId = “29”;

invTransferItemArray[0] = new InventoryTransferInventory();

invTransferItemArray[0].item = item;

invTransferItemArray[0].adjustQtyBy = System.Double.Parse(“1”);

invTransferItemArray[0].adjustQtyBySpecified = true;

InventoryTransferInventoryList invList = new InventoryTransferInventoryList();

invList.inventory = invTransferItemArray;

invTransfer.location = fromLoc;

invTransfer.transferLocation = toLoc;

invTransfer.inventoryList = invList;

WriteResponse writeRes = _service.add(invTransfer);

Leave a comment

Your email address will not be published. Required fields are marked *