All articles

Platform

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: diagnose the reference

Investigate missing or inaccessible referenced records, execution context and relationship requirements without granting blanket access.

Object-level edit permission doesn’t establish that a user can relate every record. Verify the referenced record and the actual caller before changing permissions.

Salesforce’s troubleshooting article identifies missing referenced records and insufficient access as possible causes of INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY. The error is a starting point for investigation, not proof that a broad permission grant is required.

Identify every reference in the write

Inspect the fields containing IDs: parent lookups, owner, record type and any relationship fields modified by automation. Capture the failing input record and error details in a controlled log. Don’t assume the visible parent lookup is the only reference being evaluated.

Confirm that each referenced ID belongs to the destination org and the expected object. A sandbox ID copied into production can look valid while identifying no usable record there. Check deletion and migration mappings as well.

Next, reproduce the operation as the integration user or agent identity. An administrator’s successful save can hide the record-access restriction you need to understand.

Separate the permission layers

Review object permissions, field permissions, record access and relationship-specific requirements independently. A lookup’s target may be readable while the requested operation still needs a different permission or ownership condition.

Apex behavior also depends on class API version, sharing declarations and database operation mode. The current secure Apex documentation distinguishes newer and older API-version defaults. Inspect the deployed code rather than relying on an old blanket statement that Apex always runs in system mode.

Use the smallest access change that matches the intended business process. Changing the class to without sharing or granting Modify All can conceal the immediate symptom while widening what the integration can affect.

Correct mappings before expanding access

For cross-system synchronization, maintain a mapping from stable external identifiers to destination records. Validate that mapping before attempting the relationship update. A fresh sandbox or migrated owner list may require rebuilding it.

When Salesforce and ServiceNow exchange requests, define which system owns each reference and how deletions or reassignment are propagated. An integration design should cover those cases alongside successful record creation.

Test an authorized target, an inaccessible target, a deleted target and an ID from the wrong environment. The failure response should distinguish what the authorized caller can correct without revealing protected record details.

Finish by retesting with the original identity and payload. The evidence you need is that the intended relationship now works and that an unrelated unauthorized relationship still fails.

Keep reading

All articles