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
BenTheManBenTheMan 

Very confusing INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY errors

I'm writing a simple ETL tool that processes a bunch of data from our platform DBs, and adds members to Salesforce campaigns given the results of that analysis. To do this, I'm using the beatbox module and Python (2.7.3). (I didn't post to the Python board because it appears that this error is not specific to beatbox/Python.)

 

The issue is that roughly 5% of the records return an error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY:

  • I CAN NOT tell what's different about the 5% that would cause the call to the API to fail.
  • I CAN add the leads to campaigns manually.
  • My account DOES HAVE sys admin privileges.
  • All leads that I'm attempting to update DO EXIST.

Has anyone experienced similar errors?

 

See also: http://stackoverflow.com/questions/14348369/insufficient-access-on-cross-reference-entity-errors-from-salesforce

Best Answer chosen by Admin (Salesforce Developers) 
Rakesh BoddepalliRakesh Boddepalli

There are many reasons why you get this error.

Here are the most frequent scenarios...

 

- Firstly , check the foreign key fields and check whether the user has access to those objects .

- Check whether the record type of that particular record is assigned to the user or not .

All Answers

Rakesh BoddepalliRakesh Boddepalli

There are many reasons why you get this error.

Here are the most frequent scenarios...

 

- Firstly , check the foreign key fields and check whether the user has access to those objects .

- Check whether the record type of that particular record is assigned to the user or not .

This was selected as the best answer
BenTheManBenTheMan

Hi Rakesh:

 

Thank you for your reply.

 

I'll look into the keys, but my account has "System Administrator" privileges, and unless that means something different in salesforce land, I should have read/write access to the whole DB.

 

Regarding record types. I have noticed that some of the failed records show up as "Contacts" and not "Leads" in the UI. I find this odd, because they have a LeadId associated with them anyway. I know this because the first step in my ETL is to query the lead table:

 

SELECT Email, Id FROM Lead WHERE (some condition)

 

So the question: does the above SOQL statement return only Leads (as I would expect querying the Leads table)? If a LeadID exists for any entity in the DB, is it safe to assume the entity is a "Lead"? Am I making any sense?

Rakesh BoddepalliRakesh Boddepalli

Yes, That SOQL returns only the lead records.

BenTheManBenTheMan

Rakesh:

 

It was indeed an incorrect record type. Some of the Leads had been converted to Contacts, which was causing issues.

 

Thanks for your help!

Rakesh BoddepalliRakesh Boddepalli

Good to hear, Please mark my reply as solution for the benefit of others.