The PurchaseDeliveryNotes-Object has a BatchNumbers object. With this BatchNumbers- Object it is possible to add BatchNumbers to Items and this Information that will be written to the table OIBT. That works fine.
Doing the opposite, that means getting Items from stock, I use the DeliveryNotes-Object which has as well the BatchNumbers object. This will not remove the BatchNumbers Information from the table OIBT. Its just doing the opposite, it will as well add Batch Numbers to the table OIBT.
This seems to me like being a mistake in the BusinessLogic of the DeliveryNotes-Object
My question:
Why is DeliveryNotes->Lines>BatchNumbers not removing Batch Numbers from table OIBT ?
The lines of code used for the DeliveryNotes-Object
-
Dim sbo_bns As New SAPbobsCOM.BatchNumbers
Dim sbo_dn As SAPbobsCOM.Documents
Dim lReturnCode As Long
Set sbo_dn = sbo_cx.GetBusinessObject(Object:=oDeliveryNotes)
With sbo_dn
.DocDueDate = VBA.Date
.CardCode = "C00001"
With .Lines
.ItemCode = BI100").StringValue
.Quantity = 2
.ShipDate = VBA.Date
.WarehouseCode = "01"
.Price = 10.5
With .BatchNumbers
.BatchNumber = "Bnr20.1019"
.Quantity =2
End With
End With
lReturnCode = .Add
End With