The process is simple enough:
- Create an Outbound Change Set
- Add Components to that Change Set
- Upload the Change Set to another sandbox (you can do that) or production
- Validate and Deploy the Inbound Change Set in the org the Change Set was uploaded to
Before any of that can be done, you need to establish a Deployment Connection between your sandbox and your production instance which will allow you to upload Outbound Change Sets to Production for deployment.
NOTE: You can establish Deployment Connections between two sandboxes as well for those times you need to push changes from one sandbox to another. The rest of this post assumes you're pushing from a sandbox org to a production org.
Create Deployment Connection
- First, within your production instance, click on your name at the top of the page, and then click on "Setup"
On the left-hand side, under "App Setup," expand "Deploy" and click on "Deployment Connections"
- Find the name of your sandbox and click on the "Edit" link next to it
- Check off the box that says "Allow Inbound Changes" and then click on the "Save" button
- The next thing to do is to create an Outbound Change Set within your sandbox. For this scenario, the change set will include a page layout that I want to deploy within my production instance as well as a new field that I added to the object within the sandbox. One change set, two components, one deployment. Nice!
Create Outbound Change Set
- Within your sandbox, click on your name at the top of the page again and then click on the "Setup" link
- On the left-hand side, navigate to "App Setup" --> "Deploy" and then click on "Outbound Change Sets"
- Click on the "New" button to create a new Outbound Change Set
- Provide a "Name" and "Description" for your change set.
- Click on the "Save" button.
- Within the "Change Set Components" section, click on the "Add" button.
- First, let's add the new field. Change the "Component Type" dropdown to "Custom Field"
- Next, find and select any fields that you also need to deploy that are not currently found in production.
- Click on the "Add to Change Set" button at the top of the page. Here's a quick tip -- make sure that you use the "Add To Change Set" button after you select something. Changing the component letter, page, or "Component Type" will clear any previous selections.
- Now it is time to do the same for the page layout. Change the "Component Type" to "Page Layout, find and select your new layout, and then click on "Add To Change Set" again.
1. To push your Outbound Change Set to the Production instance for deployment, click on the "Upload" button.
2. Choose your Production instance and then click on "Upload"
3. Within a few minutes you should receive an email, letting you know that your Change Set was uploaded to the production instance. Keep in mind that you don't always have to push from a sandbox to production. You can go from sandbox to sandbox or even production to sandbox.
Validation and Deployment
Once you do receive that email, it is time to deploy it.
- Within the org you've uploaded your Change Set to, click on your name at the top of the page again and then click on the "Setup" link
- On the left-hand side, navigate to "App Setup" --> "Deploy" and then this time click on "Inbound Change Sets"
- Click on your change set. Here you will be able to see information about the change set, including its components, any details, and its deployment history. You also have two options; "Validate" and "Deploy."
- Clicking on "Validate" goes through all of the actions required to deploy the change set without actually deploying it. This is always a safer bet as you can learn which components will be new, overwritten, or deleted. Sometimes you learn things from a validation that you didn't expect and can save yourself from making mistakes.
- "Deploy" first validates and if all is well will deploy your change set. Keep in mind that if you've added new layouts, they won't be assigned to a Record Type yet, so you'll have to do that manually. If you added fields, permissions won't be set up on that field as they would be if you were to manually create the field. The same goes for picklists options and their Record Type preferences.