2023 Oct 03 12:02 PM
I'm trying to add/update batches on a Sales Order document through the SAP DI API, but am getting the following error when I try to update the document:
256000177 - Document has no electronic series so cannot be updated
oOrder = oSBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
retrieve_Document(oSBOCompany, mySODocEntry, oOrder)
oOrder.Lines.SetCurrentLine(orderLine)
oOrder.Lines.BatchNumbers.SetCurrentLine(batchLine)
oOrder.Lines.BatchNumbers.BatchNumber = myBatchNumber
oOrder.Lines.BatchNumbers.Quantity = qtySelected
oOrder.Lines.BatchNumbers.Location = myBin
oOrder.Lines.BatchNumbers.Notes = myNote
oOrder.Lines.BatchNumbers.Add()
oOrder.Lines.BinAllocations.SetCurrentLine(batchLine)
oOrder.Lines.BinAllocations.Quantity = qtySelected
oOrder.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = batchLine
oOrder.Lines.BinAllocations.Add()
iRetCode = oOrder.Update()
Any suggestions on how to resolve the issue?