Loading

Salesforce 'Insufficient Privileges' Error Creating or Updating a Record After Partial Sandbox Copy Refresh

Publiseringsdato: Jul 4, 2026
Beskrivelse

An 'Insufficient Privileges' error may occur when attempting to create or update a record for a standard or custom object in a Salesforce Partial Copy Sandbox after a sandbox refresh. This error occurs because automated processes (such as Apex Triggers) in the sandbox reference record IDs that exist in Production but were not copied during the partial sandbox refresh.

Steps to Reproduce (Example: Account Record)

  1. In Production, create a Partial Copy Sandbox
  2. Log in to the Partial Sandbox
  3. Click on the Accounts tab
  4. Click New
  5. Populate required fields
  6. Click Save — the Insufficient Privileges error appears
Løsning

This error occurs when an associated record that is normally populated by an automated process (such as an Apex Trigger) is not copied during the Salesforce sandbox copy process. The trigger references a static record ID that does not exist in the sandbox, causing a cross-reference access failure.
Example: An Apex Trigger populates a Contact Lookup with a static value (e.g., 003X00000XxXXXX). When an affected user creates a new record via the UI, Salesforce throws an Insufficient Privileges exception on Save because that Contact ID does not exist in the sandbox.

How to Confirm the Root Cause

Option 1 — Use API to Identify the Offending Record
A System Administrator or user with API access can attempt to create a record via API. This will return the specific cross-reference error identifying the record causing the exception.

  1. Log in to Workbench
  2. Click Data > Insert > Single Record
  3. Populate Required Fields and click Save
  4. The error response will identify the offending record ID, for example: "Insufficient Access Rights On Cross-reference Id: 003X00000XxXXXX"

If you then navigate to the Contact record via the UI, you will see: "Data Not Available — The data you were trying to access could not be found." This confirms a static value is being populated by an automated process.

Option 2 — Isolate via Apex Trigger Debugging
Disable the Apex Triggers associated with the object one by one until the error no longer occurs. Alternatively, enable Debug Logs for the affected user to identify which trigger is causing the exception. Once identified, you can modify or disable the trigger.

Resolution Steps

  1. Isolate and disable the automated process (Apex Trigger, Process Builder, or Flow) that is populating a static record ID during record creation or update.
  2. Modify the code to either dynamically query the correct record ID in the sandbox, or to skip population when running in a sandbox environment.

Is This Working as Designed?
Yes. Partial Copy Sandboxes do not copy all records from Production. See Records Copied When You Refresh a Partial Data Sandbox for details on what is and is not copied.

Knowledge-artikkelnummer

000384000

 
Laster
Salesforce Help | Article