cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (0)