I'm trying to do a simple Stock Transfer between two different warehouses. Code goes like this in C#:
StockTransfer t = SAPB1DIConnector.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer); t.DocDate = DateTime.Now; t.FromWarehouse = "01"; t.ToWarehouse = "02"; t.Lines.ItemCode = "A01"; t.Lines.Quantity = 66; t.Lines.WarehouseCode = "02"; t.Lines.Add();
When I try t.Add() it gives me this error:
ErrorNo=-5002 ErrorDescription=10000515 - Item A01 not found in Warehouse 02
What is weird is that I'm taking this item from Warehouse 01 TO Warehouse 02, not the other way around as the error message implies.
I searched thoroughly and couldn't find StockTransfer and StockTransferLine mandatory fields. I suspect I'm not filling a mandatory field because of this thread's answer: https://archive.sap.com/discussions/thread/3573190
I tried finding them on SAP Business One SDK Help Center to no avail. I'm using SAPbobsCOM version 184.108.40.206 if that helps.
Thank you for your time!