This code snippet shows how you can create an Inventory Adjustment record via Web Services using C#. Take note that this is only exposed starting from the v2011.2 WSDL.
InventoryAdjustment invAdjustment = new InventoryAdjustment();
InventoryAdjustmentInventory[] invAdjustmentItemArray = new InventoryAdjustmentInventory[1];
RecordRef item = new RecordRef();
item.type = RecordType.inventoryItem;
item.typeSpecified = true;
item.internalId = "119";
RecordRef loc = new RecordRef();
loc.type = RecordType.location;
loc.typeSpecified = true;
loc.internalId = "1";
invAdjustmentItemArray[0] = new InventoryAdjustmentInventory();
invAdjustmentItemArray[0].item = item;
invAdjustmentItemArray[0].adjustQtyBy = System.Double.Parse("1");
invAdjustmentItemArray[0].adjustQtyBySpecified = true;
invAdjustmentItemArray[0].location = loc;
RecordRef account = new RecordRef();
account.type = RecordType.account;
account.typeSpecified = true;
account.internalId = "57";
InventoryAdjustmentInventoryList invList = new InventoryAdjustmentInventoryList();
invList.inventory = invAdjustmentItemArray;
invAdjustment.inventoryList = invList;
invAdjustment.account = account;
WriteResponse writeRes = _service.add(invAdjustment);
Saturday, November 3, 2018
Add an Inventory Adjustment record via Web Services using C#
Subscribe to:
Post Comments (Atom)
Hi,
ReplyDeleteThank you for useful posting. But I have an issue. When I make a request, NetSuite returns this error: 'Invalid account reference key XXXXX for subsidiary 1.'. Could you help me please?