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
Venus Clarke 6Venus Clarke 6 

INSUFFICIENT_ACCESS_OR_READONLY: insufficient access rights on object id error message

I am suddenly getting this error message for a User who is above the hierarcy of the Opportunity owner. This was not happending before. Can someone help? This is the result of a custom button being pressed that is supported by a flow. 
Venus Clarke 6Venus Clarke 6
Here are the error notes: 
Flow Details
Flow API Name: Request_Docs
Type: Screen Flow
Version: 9
Status: Active
Org: Vanguard Truck Centers (00D1U000000x3Fa)

Flow Interview Details
Interview Label: Request Docs 1/27/2021 7:14 AM
Current User: Lauren McGrory (0051U000007YHgr)
Start time: 1/27/2021 7:14 AM
Duration: 1 seconds

How the Interview Started
Lauren McGrory (0051U000007YHgr) started the flow interview.
API Version for Running the Flow: 49
Some of this flow's variables were set when the interview started.
recordId = 0061U00000KP0JsQAL

SCREEN: RequestDocsfrom_Coordinator
Display Text: Confirmation_Message
Value at run time:

Your Request Will be Submitted, Hit "Next" to finalize.


Selected Navigation Button: NEXT
FAST LOOKUP: Get_Opportunity_Region
Find all Opportunity records where:
Id Equals {!recordId} (0061U00000KP0JsQAL)
Store those records in {!OpportunityRecord}.
Save these field values in the variable: Id, Account_Region__c, OwnerId
Result
Successfully found records.

FAST LOOKUP: userQuery
Find all User records where:
Id Equals {!OpportunityRecord.OwnerId} (0051U000006ks1eQAA)
Store those records in {!ownerRecord}.
Save these field values in the variable: Id, Region__c
Result
Successfully found records.

DECISION: Determine_which_Email_Alert_to_Use
Skipped this outcome because its conditions weren't met: Georgia_Region
Outcome conditions:
{!ownerRecord.Region__c} (Savannah) Equals Atlanta

Skipped this outcome because its conditions weren't met: Arizona_Region
Outcome conditions:
{!ownerRecord.Region__c} (Savannah) Equals Arizona

Skipped this outcome because its conditions weren't met: Missouri_Region
Outcome conditions:
{!ownerRecord.Region__c} (Savannah) Equals St. Louis

Skipped this outcome because its conditions weren't met: Austin_Region
Outcome conditions:
{!ownerRecord.Region__c} (Savannah) Equals Austin

Outcome executed: Savannah_Region
Outcome conditions:
{!ownerRecord.Region__c} (Savannah) Equals Savannah

OPPORTUNITY.SENDS_EMAIL_TO_REQUEST_TO_COORDINATOR_FOR_DOCS (EMAIL ALERTS): Savannah_Notifications
Inputs:
SObjectRowId = {!recordId} (0061U00000KP0JsQAL)
Outputs:
None.

ASSIGNMENT: Assign_Opportunity_Variables
{!OpportunityRecord.Id} Equals {!recordId}
Result
{!OpportunityRecord.Id} = "0061U00000KP0JsQAL"

FAST UPDATE: OpportunityUpdate
Update Opportunity records whose IDs are stored in {!OpportunityRecord}.
Variable Values
[Id=0061U00000KP0JsQAL,Account_Region__c=Savannah,OwnerId=0051U000006ks1eQAA]
Result
Failed to update records whose IDs are in {!OpportunityRecord}.

Error Occurred: The flow tried to update these records: null. This error occurred: INSUFFICIENT_ACCESS_OR_READONLY: insufficient access rights on object id. You can look up ExceptionCode values in the SOAP API Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm" style="color:blue; text-decoration:underline).


Salesforce Error ID: 38120093-118608 (102705389)
 
AbhishekAbhishek (Salesforce Developers) 
Hi,

We will face "INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id" because of Sharing Settings.

To overcome this issue, check the below

1. OWD, Sharing Rules, and Role Hierarchy of the object in which you are trying to update the record.

2. Owner of the record which you are trying to update.

3. Check the trigger logic and check OWD, Sharing Rules, and Role Hierarchy of the related objects records which are getting updated.


Note:
Even though the trigger runs in System Mode, Sharing Settings will be checked. Only CRUD and FLS will not be checked against the user.


For further refernce you can check this,

https://help.avalara.com/Frequently_Asked_Questions/Error_messages_FAQ/How_do_I_resolve_'INSUFFICIENT_ACCESS_OR_READONLY%2C_insufficient_access_rights_on_object_id%3A_Error_is_in_expression'_in_Salesforce%3F


If it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
Venus Clarke 6Venus Clarke 6
Hello,

Our OWD for Opportunities is Private, but the user has edit rights to all Opportunities: 

Opportunity AccessUsers in this role can edit all opportunities associated with accounts that they own, regardless of who owns the opportunities

The User in question is an Admin, not the Opportunity Owner. Also, nothing was changed in our Sharing Settings. This button was working fine yesterday, and started rendering an error today. 
Venus Clarke 6Venus Clarke 6
This is resolved. It has something to do with the hierarchy.