All Collections
Gearset for data sandbox seeding
How do I maintain the correct Salesforce user in my target org during a data deployment?
How do I maintain the correct Salesforce user in my target org during a data deployment?
Valerio Chang avatar
Written by Valerio Chang
Updated over a week ago

When making data deployments, it can be important to maintain the same Salesforce user as the owner of a record across different orgs. Maybe you’re deploying records to production and need to keep the accuracy of your data structure intact, or perhaps you're deploying to a testing environment and need to run tests with a specific set of records and their associated users.

For example, after deploying an Account record during a data deployment, you might notice that the record’s owner in your target org has changed to the deployment user, and is therefore NOT the user who owns that record in your source org.

This most likely occurs because the same user does not exist, or is at least not configured correctly, in both your source and target orgs. To maintain the correct user field in data deployments make sure that:

  • The user exists, and is active, with the same Email in both the source and target orgs (emails with the .invalid suffix will still be matched i.e. Gearset will match [email protected] against [email protected]).

  • The user exists with the same Profile.Name in both the source and target org.

  • All referenced objects of the OwnerId field (usually User, sometimes Group) are included as related objects (in step 2. on the Select related objects and deployment methods page) during the configuration of your data deployment.

For example, the Account object here only references the User object for OwnerId,

however the Case object here references the User object and the Group object for OwnerId.

Still need some help? Contact our team and we'll be happy to assist. See how.

Did this answer your question?