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

INSUFFICIENT_ACCESS_OR_READONLY error when all permissions have been provided


We have a profile cloned from "Partner User" named "CashRelease User". i have provided Custom Object Permissions to the custom object UserRoles.I have checked all the boxes present(Read,Create,Edit,Delete).There were no check boxes for View all and Modify All.

Now when I run a piece of code as a "CashRelease User" I get the below error:-
first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id.

and when I run it as system administrator it runs fine.

After giving all permissions it still does'nt work.
Please suggest a solution or an alternative approach to perform the action.

Could you please share your insight on resolving this issue? We are facing this same issue.


thank you very much!


Here's the solution that we used.Instead of deleting the records we used isDeleted boolean field and checked and unchecked it.


The above approach is lame but due to time constraints we had to do it likewise.


Another approach that seems much better is  using the Sharing Settings.In Setup->Security Controls -> Sharing Settings ->Select the custom object that you would like to share.and do theprocesses that follow.


I thought that the isDeleted is a non-writeable field. Is it not?