INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: meaning and how to fix it

Access and login Checked against the official docs on Source: SOAP API Developer Guide: Core Data Types, StatusCode

Quick answer

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: The save affects another record that this one references (for example a lookup target or a parent), and the user cannot access that referenced record. Start with: Identify the referenced record from the ID in the message or from the lookup fields you are setting.

Typical message: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id

Cause

The save affects another record that this one references (for example a lookup target or a parent), and the user cannot access that referenced record.

How to fix INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

  1. Identify the referenced record from the ID in the message or from the lookup fields you are setting.
  2. Give the user access to it through sharing, or use a user who has access.
  3. In Apex that must act on records the user cannot see, run it in a class declared with sharing settings that fit the design, and document the reason.

Have a different message? Paste it into the error decoder, which matches it against 45 common Salesforce errors in your browser.

Frequently asked questions

What does INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY mean in Salesforce?

The save affects another record that this one references (for example a lookup target or a parent), and the user cannot access that referenced record.

How do I fix INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY?

1. Identify the referenced record from the ID in the message or from the lookup fields you are setting. 2. Give the user access to it through sharing, or use a user who has access. 3. In Apex that must act on records the user cannot see, run it in a class declared with sharing settings that fit the design, and document the reason.

More Access and login errors

SFDX Talk is unofficial documentation. It is not affiliated with, endorsed by, or sponsored by Salesforce, Inc. Message text varies slightly by release and context, so confirm against the official page before relying on it.