Deployment in Salesforce using Change sets
Deployments in Salesforce
Deployment is the migration of metadata changes between one Salesforce org to another Salesforce org.There are many tools available for Deployment in Salesforce. In this post, we will discuss about Changesets.
To use the changesets feature, we need to enable the deployment connection in our org. This would specify the Inbound and Outbound changesets on the Deployment connections page.
- In Production org, Go to Setup → Type Deployment Settings → Then it will take us to the Deployment Settings page where, it will show the orgs that were connected to this Production org for deployment purpose.
- By the same way, if we check the Sandbox org “sfdemo1” also, we can be able to see the connected org for deployment as shown below,
Now, we are going to deploy the things from Sandbox to Production. That means, we are developing the things in Sandbox and going to deploy the same in the Production org.
- So, we need to make an extra setting that, in Production org, we need to edit the deployment setting and enable the “Allow Inbound Changes” and save the setting.
As mentioned in the above screenshots, we are able to see the Changeset direction from Sandbox to Production, that means, we are able to deploy metadata from Sandbox org to Production org.
Outbound Changeset:-
In Outbound Changeset, we will add the components that we developed in our org and we can initiate the deployment process. So that the destination org will receive these via Inbound Changesets.- So, in our Sandbox org “sfdemo1”, we have created a new custom object and added some custom fields and added the data to the same. Our goal is to add these newly created custom metadata and deploy the same in our Production org.
- Login to the Sandbox org → Go to Setup → Type Changesets and select Outbound Changesets → It will take us to outbound changeset screen → Create a new changeset using New button → Add some random name to it and save it.
- To the newly created outbound change set, we are going to add the custom components that we created. Under the Change Set Components section, click the Add button → Select the Component Type as Custom Object → Then select the custom object we created → Then click Add to Changeset button.
- Repeat the same procedure to add any other custom components that we have created.
- If there are any dependencies to these custom components, then add the same to the changeset by clicking the “View/Add dependencies” button.
- Once after completing these sections, then please upload the changeset using the “Upload” button.
- After clicking on the Upload button, this would take us to a screen where, we need to confirm the target org.
- Then select the Target organization and click on Upload button.
- Then it will summarize the changeset upload history and changeset components to us. It will display a message saying that our changset was uploaded successfully and it will be available shortly on the Target org.
Inbound Changeset:-
Inbound Changeset refers to the incoming components that are coming into the target org which has been sent from another Salesforce org. This Changeset has to be deployed into the org, then only the changes will take effect. We can deploy the contents of an inbound change set as a whole but not on a component-by-component basis.- In order to see the Inbound changesets, we need to login to the Production org → Go to Setup → Type Changesets → select the Inbound Changesets → Then it will take us to Inbound Changesets screen where we can the changesets that are waiting for deployment.
- We can either delete the inbound changeset or validate and deploy the changeset from our end.
- Inorder to deploy the components, we need to validate them first by either running the tests or not running the tests.
- So, first click on the Validate option → choose the test option as “Default” → Select the Validate option → A pop-up will open and select the Ok button → Then the validation process will start and we can check the status of it under the Deployment Status.
- Click on Deployment Status hyperlink from here and it will redirect us to the Deployment Status section where it will show us the status of validation.
- Once after verifying the changeset validation, then come back to the Inbound Changeset option and deploy the changeset.
- Now click on the Deploy option → choose the test option as “Default” → Select the Deploy option → A pop-up will open and select the Ok button → Then the Deployment process will start and we can check the status of it under the Deployment Status.
- Click on the action “View Details“, then it will show the number of components that have been deployed and any failed components during the deployment process.
Like this, we can deploy any custom metadata from Sandbox to Production org using the Change Sets concept.
Very useful information
ReplyDeleteSalesforce Online Training