I am doing a StockTransfer from one warehouse to another using the StockTransfer object, but when an item is a batch item then it doesnt work, it does not do the StockTransfer nor does it throws error. It just gives the message as ("Failed to add a Inventory Transfer") which is the message I have defined as below.
Here is the code for StockTransfer, where "A00008" item code is an item manged by Batches.
Dim InventoryTransfer As SAPbobsCOM.StockTransfer
InventoryTransfer = MyCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)
InventoryTransfer.CardCode = "C0001"
InventoryTransfer.DocDate = Now
InventoryTransfer.FromWarehouse = "01"
InventoryTransfer.Lines.ItemCode = "A00008"
InventoryTransfer.Lines.WarehouseCode = "W5"
InventoryTransfer.Lines.Quantity = "2"
If (0 <> InventoryTransfer.Add()) Then
My_Application.MessageBox("Failed to add a Inventory Transfer")
My_Application.MessageBox("Succeeded to add Inventory Transfer")
Catch ex As Exception
If an item is managed by Batches then how do I do StockTransfer through code. Can any one provide me the code to do the same.
Thanks in Advance !!!