Only the owner of an object can revoke the owner’s access to that object

Hi,

We had written a callout for auto sharing and unsharing of opportunity’s record for postassign event.

On creation of the record we were auto sharing the record with the owner’s manager.

On change of the owner we are first unsharing the record with the owner’s manager and sharing it with new owner’s manager.

While doing this the error we are receiving  is  this

“Only the owner of an object can revoke the owner’s access to that object “

This error is  coming in this particular scenario

say we have a record shared with a particular user say A

now when we are trying to set the new owner as A what the code is trying to do is that,

it is trying to unshare the record with A  this is the point where we receiving this  error!!!

For e.g.

Lead record is owned by User A and is Shared with User A.

Now the Revoke code is running in context of User B and tries to run Revoke for User A who is the owner. We will get this error message.

Bye..


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

1 thought on “Only the owner of an object can revoke the owner’s access to that object”

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s