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

Updating Base Document detals after creation

I am trying to "join" a delivery with the corresponding order, with the order being captured after the order. Using the DI API I am able to update the Price of the delivery to the order price, but I get an error ("Item no. is missing [ODLN.ObjType]") when trying to update the base document details.

I know that updating an delivery after the order is captured is not standard, but I am hoping that someone has an idea....?

Jarno

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 Jun 03, 2005 at 07:43 AM

    Hi Jarno,

    If you want to create a document based on an existing one, you have to indicate per line the base type.

    In this example i'm creating an invoice (the order was just created before)

    ' Now add the invoice

    Dim strObjKey As String

    oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)

    strObjKey = oCompany.GetNewObjectKey()

    'oCompany.GetNewObjectCode(strObjCode)

    oDocument.GetByKey(strObjKey)

    oInvoice.CardCode = oDocument.CardCode

    Dim lint As Integer

    For lint = 0 To oDocument.Lines.Count - 1

    If lint > 0 Then oDocument.Lines.Add()

    oInvoice.Lines.BaseEntry = strObjCode

    oInvoice.Lines.BaseLine = lint

    oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders

    Next

    lRetCode = oInvoice.Add

    We deliver an example in the SDK under "C:\Program Files\SAP Manage\SAP Business One SDK\Samples\COM DI\VB.NET\05.OrderAndInvoice" you can refer to it for further info.

    Best regards,

    Felipe

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      SDK does not do what SAP B1 does not. I don't see a feature in B1 that lets you create a Base document from a target!!!

      does not make sense to me (or may be I don't understand your question.)

      can you explain the circumstances that compels you to do a base doc after the target has been created?

      Indika.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2005 at 06:28 PM

    Hello all,

    I had a similar problem. I look at this posting and was able to find out more information on my problem. My outcome seem to be that we can't add a line until we have multiple line.

    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.