Technical

Guide for a Successful Salesforce Deployment

Erick Leones

606 views
05/07/2023
5 mins

To create a new fields for your page layouts, to create emails to send to your clients, to create a new flow or more, first you would have to work on a sandbox and when finish deploy your changes to the production environment.

Before this guide through a successful deployment, you would have to have a sandbox created already; a sandbox is a safe environment to create or modify your organization features without affecting the workflow of the users in your production environment while you work on new features and test them. Once you have you sandbox ready and have built your new feature, when can start with the deployment.

Note:
In case this is the first time making a deployment using the sandbox, you will have to allow the recipient environment to receive the components. To allow this, please follow the next steps.

  1. Go to Setup, search “Deployment Setting” in the quick find box.
  2. Search the name of your sandbox and click “Edit”.
  3. Now check “Allow Inbound Changes” and click “Save”.

Steps to deploy your components

  • 1. Generate a new Change Set
    • a. Go to Setup, search “Outbound Deployment” in the quick find box.

    • b. To create a new Change Set, click on the “New” button.

    •  c. Type a name for the Change Set and its description(The description is optional).

  • 2. Add components to the Change Set
    • a. Once it’s created, on section “Change Set Components” click “Add”.
    • b. Now you have two principal components; use “Component Type” picklist to get the list of component filtered by your selection, once you picked, search for the name of your component, for this example I will search for a flow named “INSERT FLOW NAME”, I select “Flow Definition”, check the flow and press “Add To Change Set”.

  • 3. Upload your Change Set
    • a. Once you have all your components ready, you can upload Change Set to another environment, in this case to Production, we select production and press “Upload”.

  • 4. Deploy your Change Set
    • a. In Setup, search “Inbound Change Sets” in the quick find box.

    • b. In the section “Change Sets Awaiting Deployment” you will have all your Change Sets pending to deploy. In this section we can see the Change Set that we sent before, now we have two choices, validate and deploy.
      • I. Validate: This choice will check if your deployment will succeed when deployed, will check if you are missing a component, if there are some discrepancies that will cause an error. If no error is shown you Change Set can be deployed with no errors. This option is useful when you are not deploying yet, but you want to make sure your Change Set is ready to. For this example, we will use this option.
      • II. Deploy: This choice will deploy your changes, but will validate them first and deploy them intermediately if there are no errors.
    • c. Both choices will let you decided which test option to choose, for this example we will use the Default option because we are deploying a flow, if you want to know when to use these options please check the note below.

    • d. If everything is correct your Change Set has been deployed.

  • 5. Post-deployment steps.
    • a. Sometimes deploying is not the final step, sometimes you will require to do more steps after it, in this case, when deploying a flow, it will always be deployed as inactive, to use it you will have to manually activate it. Please have in consideration that depending on your components you will have to make post-deployment steps.

Note: When to use each option

  • No Test Run: Choose this option when you are only deploying Salesforce components or when you have thoroughly tested your components in a separate environment.
  • Run Local Tests: Use this option to test the integrity of your changes without affecting other components or integrations in your org.
  • Run All Tests: Select this option to run all tests in the target org to ensure existing functionality and integrations are not impacted.
  • Run Specified Tests: Specify a list of specific tests to run, helpful for targeting testing efforts on relevant areas or when dealing with a large number of tests.

This guide outlines the key steps for a successful Salesforce deployment, including sandbox creation, Change Set generation, component addition, deployment validation, and post-deployment tasks. By following this process and understanding test options, you can confidently deploy changes and enhance your Salesforce environment.

  1.  

Erick Leones

Erick Leones is a Salesforce Developer with expertise in automation tools, creation of Lightning Web Components, and coding. Outside work, he finds joy in drawing and swimming.


Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

We’re here to share what we know. Get our news.

Receive notifications about our latest news, services, events and products.