Deployment Step: MetaData

Updated 19 hours ago by Copado Solutions

This article is part of the Deployment Steps.

The MetaData deployment step lets you deploy metadata components from one org to another using the Metadata API. For a complete list of deployable metadata components please refer to 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: If the Check Only box is enabled, the changes will not be deployed, 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 are run, aka fast deploy).
    • Run Local Tests (all apex test classes excluding managed packages are run).
    • Run All Tests In Org (all apex test classes including managed packages are run).

For more information about test levels, check out the article Apex Tests Run While Deploying .

  • Find and Replace in files allows you 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 is now possible by replacing the Run as username with the right username in 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: 

      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: 

          

      Change Account_Executive__c with the field name to replace.
If the deployment fails with an UNKNOWN_EXCEPTION, Copado will send you an email with the zip folder used in the deployment.


How did we do?