on 12-18-2008 12:16 PM
I'm needing to issue items for production via the DI API. I'm coding against SAP Business One 2005 A (6.80.319) SP: 01 PL: 20
I have the following code as per examples on the SDN.
SAPbobsCOM.Documents oGoodsIssue;
SAPbobsCOM.Document_Lines oGoodsLines;
GoodsIssue = (SAPbobsCOM.Documents)Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry);
oGoodsLines = oGoodsIssue.Lines;
oGoodsLines.BaseEntry = 8575; // Production Order DocEntry
oGoodsLines.BaseType = 0;
oGoodsLines.Quantity = 1;
int retCode = oGoodsIssue.Add();
string errMsg;
if (retCode != 0)
{
Company.GetLastError(out retCode, out errMsg);
}
However, a Recieipt from Production is created!
What am I doing wrong?
Thanks
Colin
Colin,
from your code snippet I am unable to see the object type you are retrieving from the company object. Make sure that the object type is oInventoryGenExit, and not oInventoryGenEntry. When you issue stock to production, you are relieving inventory from stock, and when receiving from production, you are replenishing inventory stock.
Anthony Mann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Colin,
you have to use
Dim oInventoryGenExit As SAPbobsCOM.Documents
instead of oInventoryGenEntry
and then make sure if your item is not a batch or serial managed. If so then you have to pass serial or batch number also with that item.
Hepil Doshi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.