Once you've selected the top-level objects for your data deployment, Gearset will analyze your data model and present you with further configuration options to customize your data deployment. You can either tweak these options, or leave them as the default to accept Gearset's recommendations.
After clicking NEXT
on the first configuration step of the data deployment, you'll be presented with a page like this:
On the left-hand side are the objects that you selected in the previous step. On the right hand side are the objects related to the objects selected in the previous step.
Step 1: Selecting a deployment method
For each object in the data deployment, the deployment method should be selected. The options are:
Create new records
: all records deployed will be created as new.Upsert records
: Gearset will try to match all records in the deployment with records in the target org. If an existing record exists, the record in the target will be updated. If it doesn't, a new record will be created in the target org.Update records
: Gearset will try to match all records in the deployment with records in the target org. If an existing record exists, the record in the target will be updated. If it doesn't the record will be omitted from the deployment.Preserve references
: No records will be deployed. Gearset will try to match any references to the object, with records in the target. If no match can be found the reference will be blanked out.
Step 2: Matching existing records
You can pick fields to use when matching records between source and target. It is essential that the combination of fields chosen, makes a unique key for every record.
If Id
is chosen as the field to use, the salesforce id will be compared in source and target. If no match is found, Gearset will check the deployment history to see if the record has been deployed previously. If it has, the record previously created by Gearset will be updated in the target.
When a full or partial copy sandbox is created, the records created by Salesforce will have the same Salesforce Ids as those in production.
To use a different field it must be specified as an "External ID" or "lookup ID" field within Salesforce.
An
External ID
is a custom field property, and this is the view in Salesforce:
The
ID Lookup
property is visible only via the API in Workbench:
Note: While it is possible to mark an "Auto Number
" field as an external ID in Salesforce, you will not be able to use an "Auto number
" field for upserting, as it is neither create-able nor update-able).
Step 3: Choosing the related objects to include
On the right-hand side, objects related to the objects you selected in the previous step are displayed. By default, all of these will also be included in your deployment. You can override this, by deselecting the checkbox next to a particular related object.
As on the left-hand side, you can also select which field to use as the external ID for each object.
Referencing existing records
Some standard objects have specific requirements that make them hard to deploy. These include User
, UserRole
, RecordType
and Group
.
In these cases, Gearset will apply special handling to make sure that the deployment works correctly. You won't be able to change the deployment method for these objects.
These records will be downloaded from both the source and target, and cross-referenced internally by Gearset (rather than by using Salesforce's external ID mechanism).
New User
records will never be deployed by Gearset. If an OwnerId
field on a record references a user that doesn't exist in the target, it will be set to the user carrying out the data deployment.