cancel
Showing results for 
Search instead for 
Did you mean: 

Issue for Production

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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