Description
The following sample shows how to remove a record from the database. Use this sample as a basis to all business objects of master data type (not documents).
Dim vItem As SAPbobsCOM.Items
Set vItem = vCmp.GetBusinessObject(oItems)
RetVal = vItem.GetByKey("A00043")
    If RetVal <> 0 Then
        vCmp.GetLastError ErrCode, ErrMsg
        MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg
            Exit Sub
    End If
RetVal = vItem.Remove
    If RetVal <> 0 Then
        vCmp.GetLastError ErrCode, ErrMsg
        MsgBox "Failed to Remove the record " & ErrCode & " " & ErrMsg
            Exit Sub
    End If |