Skip to Content
avatar image
Former Member

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

                oDocument.Lines.SetCurrentLine(LineCount)

                If LineCount = 0 Then

                    oDocument.Lines.UoMEntry = 2

                End If

            Next

            If oDocument.Update <> 0 Then

            End If

        End If

    End Sub

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 09, 2015 at 12:22 PM

    Hi,

    That sounds like a bug. Please log a support message on the SAP Service Marketplace..

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 09, 2015 at 01:52 PM

    Hi,

         Most of time I've get this error. What I do is removed the SAPBobsdiapi in reference and clean - build. Or close my visual studio and run again.

    Regards,

    Add comment
    10|10000 characters needed characters exceeded