Loading

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

Date de publication: Jul 9, 2025
Description

An error may occur when attempting to create or update a record for a standard or custom object after a partial sandbox refresh:

Insufficient Privileges

You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. For more information, see Insufficient Privileges Errors. 

Click here to return to the previous page.


Steps to Reproduce [ Ex: Account Record].

1. In Production, follow the steps to Create a Partial Copy Sandbox
2. Login to the Partial Sandbox.
3. Click on the Accounts Tab - 001/o
5. Click on 'New'
6. Populate "Required Fields"
7. See the "Insufficient Privileges"  error.

Résolution

This error happens when the associated record that is usually populated via an automated process is not copied during the Sandbox copy process.

For example, we have an Apex Trigger that is populating a Contact Lookup with a static value, ex: 003X00000XxXXXX. When the affected user attempts to create a new record via the UI, they see an exception (Insufficient Privileges) on Save.

How do I confirm for sure whether I'm affected by this issue?


Option 1

The System Administrator or a User with API access can attempt to create a record via the API. This will give you the offending record that is causing the exception.

Example:
1.Login to Workbench
2. Click on Data | Insert | Single Record
3. Populate Required Fields.
4. Save.
5. You will see an error similar to the following:

 

 Salesforce IdResultStatus
1 Insufficient Access Rights On Cross-reference Id: 003X00000XxXXXXINSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY


If you navigate to the contact record via the UI, you will see the following error:

Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page. 

This confirms that a static value is indeed being populated via an automated process on record creation/update.

Option 2

Disable the Apex Triggers associated to the object one by one until you no longer get the error. You can also enable Debug Logs for the affected user. This will narrow the cause of the issue to the Apex Trigger, which you can then address by modifying OR disabling.

Resolution:

1. Isolate and disable the automated process populating a static value on the record during Create/Update.
2. Isolate and modify the code.

Is this Working As Designed?

Yes. Please refer to the following article: Records copied when you refresh Partial Data sandbox
 

Numéro d’article de la base de connaissances

000384000

 
Chargement
Salesforce Help | Article