Error When Deleting Older Document Requests in Opero Documents: “INSUFFICIENT_ACCESS_OR_READONLY”
Summary
If you’re encountering the error INSUFFICIENT_ACCESS_OR_READONLY when using the Opero Documents app, it’s likely due to missing Delete permissions on the Document Request object. This error typically occurs when the app attempts to delete Document Request records that are more than 30 days old as part of its background cleanup process.
Error Message
Apex script unhandled exception... Delete failed. First exception on row 0 with id [ID]; first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: [] ClassApex script unhandled exception by user/organization: []/[] Failed to process batch for class 'rsdoc.GenerateDocumentsBatch' for job id '[]' caused by: System.DmlException: Delete failed. First exception on row 0 with id []; first error: INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: [] Class.rsdoc.SObjectService.DmlDelete: line [], column [] Class.rsdoc.GenerateDocumentsBatch.finish: line [], column []
Cause
Opero Documents uses a background batch process (GenerateDocumentsBatch) to generate and clean up document requests. If the user initiating the process lacks Delete permission on the Document Request object, the system cannot remove older records, resulting in this error.
How to Resolve
Step 1: Verify User Permissions
Ensure that the user has Delete access on the Document Request object. While this permission is not included in the Opero Documents User permission set, it is included in the Opero Documents Administrator permission set.
Permission Set Overview
| Permission Set | Delete on Document Request | Description |
|---|---|---|
| Opero Documents User | ❌ No | Basic access to create and manage documents. Does not include delete permissions. |
| Opero Documents Administrator | ✅ Yes | Full access, including delete. Suitable for admins or power users managing document automation. |
Resolution Options
- If your users only have the Opero Documents User permission set, you’ll need to either:
- Clone the permission set and add Delete access to the Document Request object, or
- Create a supplemental permission set that grants Delete on Document Request and assign it alongside the user permission set.
- If your users already have the Opero Documents Administrator permission set, no changes are needed—they already have the required access.
You may also optionally grant Modify All on the Document Request object if appropriate for your org’s security model.
Step 2: Test with Proper Access
- Identify which user(s) triggered the error.
- Confirm whether it’s affecting all users or just specific individuals.
- Assign full access to the Document Request object as needed.
- Attempt document generation again to verify resolution.
Additional Notes
- This issue is most commonly triggered by scheduled document generation jobs that automatically clean up Document Request records older than 30 days.
- These batch jobs are part of the Opero Documents app’s internal automation.
Need Help?
If you’ve updated permissions and still receive errors, please Grant Login Access to Opero Support and send an email to support@opero.com with the following information:
- Your Salesforce Org ID
- The full error message (copy/paste or screenshot)