Skip to main content

Resolving data deployment errors: unable to create/update fields

Troubleshooting errors when attempting to deploy records that contain audit fields

Callum Whitfield avatar
Written by Callum Whitfield
Updated over a month ago

When deploying or restoring data to Salesforce, you may encounter an error similar to the following:

INVALID_FIELD_FOR_INSERT_UPDATE:Unable to create/update fields: X. Please check the security settings and verify that it is read/write for your profile or permission set.

In Gearset this will look like:

image

What causes the error?

This error can occur when you try to deploy data that contains an audit field, that is a field that is automatically populated such as Created By, Created Date, Last Modified by ID and more.

How do I fix the error?

There are two main options to resolve this, depending on the importance of populating these fields.

Adding permission to create audit fields

If it is important for these values to be set, then you will need to enable the 'Create Audit Fields' permission for your user (and your org if it is not enabled already).

Firstly, you must verify that this permission can be added to a user by first navigating to user interface settings and enabling the setting to use this permission (see Salesforce's support documentation).

Step 1. From Setup, enter User into the Quick Find box, scroll down and select User Interface.

Step 2. Near the bottom, check Enable "Set Audit Fields upon Record Creation" and "Update Records with Inactive Owners" User Permissions is enabled under 'Setup'.

Step 3. Click Save.

Now, with this setting enabled, you must assign the 'Create Audit Fields' permission to the relevant users (see Salesforce's support documentation).

Step 1. From Setup, enter Permission Sets into the Quick Find box and either select an existing permission set or create a new one that is assigned to your user.

Step 2. Under System Permissions, press 'Edit'.

Step 3. Find 'Set Audit Fields upon Record Creation' and check the box. If you do not see this option, then it's likely that you haven't enabled the setting described above.

Step 4. Click Save

You should now be able to deploy records which contain audit fields.

Ignoring the audit fields

Alternatively, if the contents of the audit fields are not important, you can ignore them in the data deployment. If this deployment is via a restore, then you will need to choose the 'Advanced' restore option.

On the step where related objects are selected, use the dropdown next to the 'Next' button to select Exclude fields.

Then, select the audit fields that caused deployment problems and exclude them by unchecking the checkbox.

Then continue the deployment as usual - this will ignore those fields and your deployment should succeed.

Did this answer your question?