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

Delivery Note Error - One of the base documents has already been closed

Hi Guys,

We have an issue when creating Delivery Note via SDK for back orders that are coming from Sales Quotations.

The Delivery Note gets created when picking the Sales order for first time. However, after release a new PickID for the remaining items, the Delivery Note

The issue is that the Sales Quotation lines are getting closed after creating the first Delivery Note even if not all lines in the Sales Order are picked.

So , when the Back Order is released to a new Pick, the SDK is able to update the Pick list but is not able to create the Delivery Note.

The error returned from the SDK is 'One of the base documents has already been closed'.

This is because the Sales Quotation Lines are closed since the creation of the first Delivery Note. You can successfully create Delivery Note via UI but this issue arises when trying to create a Delivery Note for Back Orders that comes from Sales Quotation.

So, the Back Order lines in the Sales Order are in 'Open' status but in the Sales Quotation are in 'Closed' status.

When creating the Delivery Note, we do specify the 'DocEntry' field in the Delivery Note same as it is in the Sales Order Line. Basically, it is DLN1.DocEntry = RDR1.DocEntry.

Not sure why it is still tracking the Sales Quotation.


Can someone help us with this issue?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2015 at 03:51 AM

    Hi folks,

    The issue was produced by the Expenses(Freight) Object in the Sales Order.

    The Expenses lines were being closed when creating the first Delivery Note.

    So, when processing the Back Order and attempting to create the Delivery note for the Back Order you need to check if the status of the Expense line before adding it to the Delivery Note.

    Something like:

    If oooOrder.Expenses.ExpenseCode > 0 Then

    If Not oooOrder.Expenses.Status = SAPbobsCOM.BoStatus.bost_Close Then

    If Not ie = 0 Then

    oDelivery.Expenses.Add()

    End If

    oDelivery.Expenses.BaseDocType = SAPbobsCOM.BoObjectTypes.oOrders

    oDelivery.Expenses.BaseDocEntry = lCardCode_Orders(y)

    oDelivery.Expenses.BaseDocLine = oooOrder.Expenses.LineNum

    oDelivery.Expenses.ExpenseCode = oooOrder.Expenses.ExpenseCode

    oDelivery.Expenses.TaxCode = oooOrder.Expenses.TaxCode

    ie = ie + 1

    End If

    End If

    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.