cancel
Showing results for 
Search instead for 
Did you mean: 

Update Uom code - Attempted to read or write protected memory

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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,

Johan_H
Active Contributor
0 Kudos

Hi,

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

Regards,

Johan