How to solve the problem of Insufficient Access Rights on Cross-Reference Id?

195    Asked by DianaCampbell in Salesforce , Asked on Jul 31, 2023

 The error showing “insufficient access on cross reference entity” is being displayed. While inserting the Opportunity followed by Opportunity Line item from the VisualForce page through the controller, I am logged in as a user whose profile license is “authenticated website”. However, while logged in as another user whose license is “customer portal manager” the code works well. Both orgs possess Opportunity OWD “read only” and opportunity line item “controlled by parent” To fix the issue I used “without sharing” on a class that runs the insertion code, and it works well from “authenticated website” user. Can you fix the error?

Answered by Diane Carr

This is a common problem while trying to update and generate data with low access on the record. Verify the user profile and see if the user has permission to insert the record. If the user possesses access, see if the user can update and insert fields such as record types, lookup fields and others.


In order to troubleshoot, follow these steps below:

Check if the user possesses access to track ids of the lookup fields and master-detail fields present in the record.

See the user profile that must have access to the given record types. Record’s owner field receives a shared record while the record is updated. When the apex code attempts at creating the same share record explicitly, the error message is seen.

Verify if the apex code is attempting to make shared records where the present user do not possess access.

The Salesforce Certification Training offered at JanBask Training provides experience like offline classes to help candidates master the Salesforce Development and Administration in a better way to face the tough job market scenario. The course guarantees job success and lets you qualify the certification exam through intensive, and expert-led virtual sessions and hands-on practical assignments. The course will teach you to create and configure the salesforce account to help you gather, extract, and examine the data relevant to the customer base. You can also avail the Force.com platform to create and use the advanced cloud apps with utmost confidence.


Your Answer

Interviews

Parent Categories