Skip to Content
0
Former Member
Aug 20, 2009 at 01:08 PM

Additional expenses on existing delivery

26 Views

Im trying to add additional expenses on delivery which is created already and has no invoice (customer direction).

I have code

Dim odocument As SAPbobsCOM.Documents
            odocument = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
            If odocument.GetByKey(docentry) Then

                odocument.Expenses.Add()
                odocument.Expenses.SetCurrentLine(1)
                odocument.Expenses.ExpenseCode = 1
                odocument.Expenses.LineTotal = value

                Dim err_code As Integer
                err_code = odocument.Update()
                Dim err_msg As String

                If err_code <> 0 Then
                    oCompany.GetLastError(err_code, err_msg)
                    MsgBox(err_msg)
                End If

            End If

but it alwazs ends with internal error after .update. Is it even possible to update existing delivery with expenses through DI?