Skip to Content
0
Former Member
Jan 30, 2007 at 01:16 PM

Error code -1013

93 Views

I've tried to update an user field, but sometimes it returns the error code -1013, with the message: Found error, code=-1013,msg=Invalid valid value 'A' in Enum 'BoYesNoEnum'

the code is the following:

Dim lRetCode As Integer

Dim lErrCode As Long

Dim RstStatus As SAPbobsCOM.Documents

Dim nErr As Long

Dim errMsg As String

Set RstStatus = oCompany.GetBusinessObject(oInvoices)

If RstStatus.GetByKey("15") = True Then

RstStatus.UserFields.Fields.Item(0).Value = "1"

lRetCode = RstStatus.Update

If lRetCode <> 0 Then

Call oCompany.GetLastError(nErr, errMsg)

If (nErr <> 0) Then

MsgBox ("Found error, code=" + Str(nErr) + ",msg=" + errMsg)

End If

End If

End If

tks!

Luciano