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
VishalAscVishalAsc 

AccountShare

Hi,

I am creating an AccountShare object.

I am logged in as System Administrator while doing so.

 

But still I am getting following error : INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY insufficient access rights on cross-reference id: []:

 

Any suggestion what might be wrong?

Best Answer chosen by Admin (Salesforce Developers) 
VishalAscVishalAsc

I could resolve that issue.

And the cause accroding to me was that i was trying to delete share records fro System administrator user, which is something not allowed.

 

I had create and delete AccountShare logic just 1 line apart and so I was thinking that create is giving error, but actually it was delete that was giving error.

 

Hope this helps somebody...

All Answers

zachelrathzachelrath

Can you post the relevant code (i.e. the lines where you create the AccountShare record)?

VishalAscVishalAsc

I could resolve that issue.

And the cause accroding to me was that i was trying to delete share records fro System administrator user, which is something not allowed.

 

I had create and delete AccountShare logic just 1 line apart and so I was thinking that create is giving error, but actually it was delete that was giving error.

 

Hope this helps somebody...

This was selected as the best answer
WYamWYam

Chances are you're trying to grant a lower level of access than is already stated.

 

For example, I think the default access for the owner of the Account is "All" via the API. If you're trying to grant "Write" in your code, it'll yell at you. I hope that helps.