Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How can resolve the error - insufficient access rights on cross reference id

Asked by Aaditya Srivastva Sep 22, 2022 1.1K views 1 answer
Share

About this question

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []

Scenario is, I am inserting an Opportunity and then Opportunity Line Item from a VisualForce page using a controller. When I am doing this I am logged in as a user whose profile licence is "Authenticated Website".

Strange thing is, when on another org logged in as a user whose user profile licence is Customer Portal Manager the same code works fine. Both orgs have Opportunity OWD "Read Only" and Opportunity line item "Controlled By Parent".

To resolve this problem I've used "without sharing" in the class which executes the insertion code, and it works fine from the "Authenticated Website" user. As this may be a security issue when we try to list the app on AppExchange, is there any other way to resolve this problem?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.