Hi SBO forum, I have a problem when I try to delete some userfields, my code is the next:
Dim oCampo As SAPbobsCOM.UserFieldsMD
Dim oRecord As SAPbobsCOM.Recordset
Dim lCode As Long
Dim sQuery As String
Dim sMensaje As String
Set oCampo = oCompany.GetBusinessObject(oUserFields)
Set oRecord = oCompany.GetBusinessObject(BoRecordset)
sQuery = "SELECT FIELDID FROM CUFD WHERE TABLEID = '" & sTabla & " ' AND ALIASID = '" & sCampo & "' "
oRecord.DoQuery sQuery
If oCampo.GetByKey(sTabla, oRecord.Fields(0).Value) Then
lCode = oCampo.Remove
If lCode <> 0 Then
oCompany.GetLastError lCode, sMensaje
MsgBox "Ocurrió el siguiente error: " & sMensaje, vbCritical, "Error"
End If
End If
And then, shows me the next error:
The Mete Data for this object cannot be updated,
since it's ref count is bigger then 0.
Any suggestions?
Hi everyone!!