Skip to Content
author's profile photo Former Member
Former Member

Issue for Production

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 04:21 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 06:25 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.