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

I have created an object named as "Component" which has Master-Detail Relationship with Opportunity Object.
On Opportunity we have a button says "Create Component", when user clicks on it it takes users to a new page and ask for some values and create component record.
It was all about object structure and component creation procedure.

I am getting "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []" when i click on "Create Component" and on component page when i click on "Create" button.
Actually "create Component" page has a create button and when clicks on this it creates component records.

My profile has –

1) Read, Create, Edit, View All on Opportunity Object 
2) Read, Create, Edit, View All on Component Object

1) This exception comes in a particular scenario when Record Creator
is me but Owner is some one else. If record owner and creator both is
me then i don't get this exception.

2) Secondly if i set Opportunity OWD setting to public Read/Write then
this exception doesn't come if owner is someone else as well.

I am not getting any solution and clue why i am getting this exception. Please help me out

What are differences between owner and creator of record? What happens
if creator changes the owner of record? will Creator still have all the
rights on the records or all the rights will be transferred to Owner?

thanks in advance

Best Answer

This is due to how Master-Detail security is setup. Detail objects inherit permissions from their Master. If the record owner does not have Edit on the Opportunity they will not be able to add any Detail records, including your Component. There are two things you can try:

  1. Add or alter your sharing rules/profiles to give owners the permissions they need
  2. Instead of using a Master-Detail, set component to use a Lookup to Opportunity. Then you do not need to worry about the permissions on the Opportunity.

Update

The record's creator does not have any inherit rights; it is just an audit field. Permissions are based on the Owner, Sharing Rules, and if the user in question has View All, Modify All, View All Data, or Modify All Data.

Related Topic