Deployment Step: Metadata

Updated 20 hours ago by David Venegas

This article is part of the Deployment Steps.

The Metadata deployment step allows you to deploy metadata components from one Org to another using the Metadata API. For a complete list of deployable metadata components please refer to the Salesforce Metadata API documentation.

When this deployment step is executed, the selected metadata components will be retrieved from the Source Org and then deployed to the Destination Org. 

Step Options:

  • Check Only option will not deploy the changes, it will be a Validation only deployment.
  • Test Level deploy options:
    • No Test Run (no apex test are run unless it is a production deployment).
    • Run Specified Tests (only included apex test classes will run, aka Fast Deploy).
    • Run Local Tests (all apex test classes excluding managed packages).
    • Run All Tests In Org (all apex test classes including managed packages).

More information regarding Test Levels.

  • Find and Replace in files allows users to find a specific text inside the Metadata files using a Regular Expression for matching and replacing matching pieces with a given text. Use cases for this feature are countless, but here are a few examples:
    • Deploy Outbound messages are now possible! by replacing the "Run as" username with the right username on the destination org. Find regex: 

      user@server\.com\.dev

       Replace with: 

      user2@server.com.uat

    • Deactivate workflow rules: Find regex: 

      <active>true</active>

       Replace with: 

      <active>false</active>

    • Remove Weblinks from Page layouts: Find regex:  

      <customLink>[.\S]*</customLink>

        Replace with: 

          

    • Skip a specific user Permission (typically needed when deploying between two different Salesforce releases). Find regex:

       (?s)(<userPermissions>(?:(?!<userPermissions>).)*?<name>DelegatedTwoFactor</name>(?:(?!<userPermissions>).)*?</userPermissions>)

      Replace with: 

      Note: change DelegatedTwoFactor with the permission name to replace.
    • Skip a field from a layout, typically needed when the field doesn't exist in the destination. Find regex: 

      (?s)(<layoutItems>(?:(?!<layoutItems>).)*?<field>Account_Executive__c</field>(?:(?!<layoutItems>).)*?</layoutItems>)

      Replace with: 

          

      Note: change Account_Executive__c with the field name to replace

If the deployment fails with a UNKNOWN_EXCEPTION, Copado will send an email to the user with the zip folder used in the deployment.


How did we do?