You need to sign in to do that
Don't have an account?
SnowMore
Delete fails with no error message
When a user has insufficient privileges to delete a record -- say, an opportunity owned by someone else -- the delete fails but there's no error message. The following code is straight out of the Office Tolkit VB code sample:
On Error GoTo handleError
Dim MyOppObject(1) As SObject3
Set MyOppObject(0) = g_sfApi.CreateObject("opportunity")
MyOppObject(0)("id") = MyID
g_sfApi.Delete MyOppObject, False
But no error is triggered when the delete fails due to insufficient privileges.
Any ideas on how to trap this condition?
That's not the answer. the following lines of code:
MsgBox MyOppObject(0).Error
MsgBox MyOppObject(0).ErrorMessage
return error code 0 and an empty string for error message, regardless of whether the object was successfully deleted or not.
The on-line documentation says the following:
It's step 4 that I can't figure out. There's sample code for Java and C#, but nothing for VB. And there's no mention at all of DeleteResult in the Office Toolkit documentation.