Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Update Uom code - Attempted to read or write protected memory

Hi Team,

i am using SBO 9.1 DI API. When i create a new console program to update UomCode, it is working fine. But, when i create a new add on program, it throw the error "Attempted to read or write protected memory" in Lines.UoMEntry...Cannot figure out why

  Public Shared Sub UpdateSO()

        Dim oDocument As SAPbobsCOM.Documents

        Dim DocEntry As Integer

        DocEntry = "41"

        oDocument = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)

        If oDocument.GetByKey(DocEntry) Then

            For LineCount = 0 To oDocument.Lines.Count - 1


                If LineCount = 0 Then

                    oDocument.Lines.UoMEntry = 2

                End If


            If oDocument.Update <> 0 Then

            End If

        End If

    End Sub

Former Member
Not what you were looking for? View more on this topic or Ask a question