INSUFFICIENT_ACCESS_OR_READONLY: meaning and how to fix it
Quick answer
INSUFFICIENT_ACCESS_OR_READONLY: The running user lacks the permission or record access needed for the action, for example edit or delete rights on that record through ownership, sharing or object permissions. Start with: Check object permissions (create, read, edit, delete) for the user in their profile and permission sets.
Typical message: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id
Cause
The running user lacks the permission or record access needed for the action, for example edit or delete rights on that record through ownership, sharing or object permissions.
How to fix INSUFFICIENT_ACCESS_OR_READONLY
- Check object permissions (create, read, edit, delete) for the user in their profile and permission sets.
- Check record access: the owner, role hierarchy, sharing rules and org-wide defaults for the object.
- Reproduce as the user: use Login As in a sandbox or run the Apex in a System.runAs test.
Have a different message? Paste it into the error decoder, which matches it against 45 common Salesforce errors in your browser.
Frequently asked questions
What does INSUFFICIENT_ACCESS_OR_READONLY mean in Salesforce?
The running user lacks the permission or record access needed for the action, for example edit or delete rights on that record through ownership, sharing or object permissions.
How do I fix INSUFFICIENT_ACCESS_OR_READONLY?
1. Check object permissions (create, read, edit, delete) for the user in their profile and permission sets. 2. Check record access: the owner, role hierarchy, sharing rules and org-wide defaults for the object. 3. Reproduce as the user: use Login As in a sandbox or run the Apex in a System.runAs test.
More Access and login errors
SFDX Talk is unofficial documentation. It is not affiliated with, endorsed by, or sponsored by Salesforce, Inc. Message text varies slightly by release and context, so confirm against the official page before relying on it.