Deploying metadata changes between your orgs with Gearset can be done in a few clicks. To deploy changes, you must start from the comparison results between a source and target. To learn how to run a comparison, view this support article.
When you run a deployment, the metadata configuration from your source is applied to your target, bringing the orgs into sync.
Select metadata items to deploy
The first stage to deploying some changes is selecting the metadata items you want to include in the package.
- To select an item, click the checkbox next to its name. Below I've selected the Activity custom object that I've created in my developer org.
To view all selected items at any point, navigate to the Selected items tab. To select all items in the table, click the checkbox in the title row. You can combine results filtering and searching to narrow down the results in the table and quickly select multiple items.
Identifying subcomponents and dependencies
Gearset can help you identify and include metadata dependencies automatically through its unique dependency analysis. For supported metadata types, related items and dependencies will be listed in a tree view in the results grid.
- To view an item's dependencies, click the small black arrow next to the metadata item name. This will expand the item out into a tree view. There are several subsections of dependency:
- Components: lists the constituent components of the parent item; in a custom object, for example, this would include its custom fields and list views
- Depends on: the parent item depends on metadata in this list; to deploy the parent item, you will also need to include these items in your deployment (if they have changed)
- Profiles and permissions: displays related profile and permission items to the parent item; for example, the field level security changes associated with creating a new custom field
- Used by: metadata in this category depend on the parent item. To deploy these items, you will have to have first deployed the parent object or include it in the same deployment as these dependent items
- By expanding out the profiles and permissions section for the Charitable application, you can see the related profile changes. Selecting any of these changes will show the differences in the diff viewer below the table.
- To include the associated profile and permission changes in the deployment, simply click the checkbox next to the Profiles and permissions header.
Note: Gearset automatically breaks down profiles into their constituent metadata components. This means you can deploy just small parts of a profile without bringing across the whole profile from your source. This granularity lets you have total control over what you deploy. For example, if you wish to deploy a few field level security changes with a new custom field, you can do so without deploying the rest of the affected profiles.
Gearset's automatic problem analysis
Once you have selected some items you wish to deploy, click Next to prepare the deployment package.
Gearset will now check your deployment package for any missing dependencies which are likely to cause your deployment to fail. If it finds anything which may cause issues, it will suggest changes to your package to fix them. These fixes are optional, but following the recommendations will make your package more likely to deploy successfully.
In the screenshot below, Gearset has spotted an issue. I included a Custom field permission in my selection, but forgot to add the parent Custom field. This missing dependency will likely cause the deployment to fail.
Gearset is suggesting that the Custom field permission be removed to resolve the issue. When you see a problem analysis page like this, there are three options:
- To accept this suggestion, leave the checkbox(es) selected and click Next
- To go back and modify your metadata selection, click Back to comparison and change the selected metadata items
- To continue to the pre-deployment summary without accepting the suggested changes, uncheck the checkbox(es) and click Next
In this case Gearset has correctly reminded me that I forgot the Custom field, so I will go back to the comparison and select it.
When I then click Next, no issues are detected and I am taken to the pre-deployment summary.
The pre-deployment summary shows you key information about what you're about to deploy to your target. This includes the metadata items and their change type, as well as confirming your source and target.
There are several actions that you can perform at this point:
- Add deployment notes: adding a text note helps identify why you ran the deployment (e.g. a sprint name, or a feature release). Any text entered here is carried through to the post-deployment reports Gearset generates
- Attach Jira ticket: if you're an Enterprise-tier user you can attach Jira tickets to your deployments
- Download package: save the final package file to your computer - useful if you want to inspect the raw XML before you release the changes
- Export: save the pre-deployment summary to a CSV file
- Deploy now: deploy the changes to your target
- Validate deployment: perform a check-only deployment, running any tests in your target and checking the validity of the components without actually applying them to your target
- Back to comparison: if you want to make some changes to the items in your deployment package, click this to return to the comparison results
For advanced users, you can also specify the level of testing you would like to carry out using the arrows on the Deploy now and Validate deployment buttons. For more information on setting test levels, see our article on Apex test levels.
Running the deployment
Clicking Deploy now will begin the deployment. Once this process begins, Gearset will upload the package to Salesforce and queue it up for release. Depending on the number of components you are deploying, the performance of your Salesforce org, and the number of tests to run, this process can take a while.
You can safely navigate away from this page and the deployment will continue to run. To view the status of any deployments that are in-progress, head to the deployment history page.
When the deployment finishes, you'll see a summary of the key information. Gearset will email you a copy of the deployment report as a PDF. You can also download this report from the deployment page, or from your deployment history.
And that's it! You have deployed the selected changes from your source to your target.