function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Uday KUday K 

INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id

Hi All,

Can someone help me out to overcome this issue please.

Contact object is parent to custom object called RA via look up relationship, OWD settings on Contact is PRIVATE and profile permission for an user is only READ permission. There is a trigger on RA object that updates the related contact when RA status is assigned. So, when an user with above permissions change the status on RA to Assigned, we are getting apex script error : INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id. 

Please can someone give any idea how to overcome this error.

Its very urgent. early response is appreciated.

James LoghryJames Loghry

Sounds like you need to do a few things:

1.  Update the profile so that they have write permission on the contact.
2.  Set up a sharing rule of some wort so that if the user has access to the RA record, then they can insert the Contact as well.

Optionally, you could try moving the logic into a separate class, and give that class the "without sharing" modifier to see if that works.