Request A Demo
Back to All Blog Articles

Deploying Salesforce Custom Metadata using FlexDeploy

FlexDeploy’s rich DevOps features, flexibility in controlling release automation, and integrated Salesforce support provide a highly efficient solution for your enterprise. If you are looking for an introduction to FlexDeploy’s support for Salesforce, start with this blog series.

In this blog, we’ll cover how to deploy Custom Metadata object types in Salesforce using FlexDeploy.

Custom Metadata Type Definition

The Custom Metadata Type in Salesforce is defined as a custom object, page layout, and any custom metadata type records with data values. When a new Custom Metadata Type is created, the actual definition of this item is a custom object with an _mdt suffix. The Custom Metadata Type can have custom fields, validations, and related Custom Metadata Type and page layouts like any other custom object.

Custom Data Type setup details contain standard and custom fields, validation rules, and page layouts.

A setup screen from Customer Medadata Types.

When deploying a new Custom Metadata Type item, we need to include the Custom Metadata Type record, custom object, and page layouts in the FlexDeploy package.

Deploying a new Custom Metadata Type Item

Add Custom Metadata Type Records

Once development is done in the sandbox/development Salesforce Organization, we can discover the changes and artifacts, add them to a package, and deploy them to desired environments using FlexDeploy.

After Navigating to the Projects tab in FlexDeploy, click on the Salesforce Org Management tab to go to the artifact discovery page. You can either directly compare and change to the repository or compare between two Orgs or from a package to Org.

Select SCM to Org to compare the metadata from the repository (respective Branch) against the salesforce org. In the Discovery Window you can search for the name of the Custom Metadata to get all the related custom metadata files and records as shown below.

Search the Discovery Window to get all the related files of custom metadata and records as shown below.

To deploy this new Custom Metadata Type record, you will need to ensure the custom object it belongs to is also deployed. Select all the relevant artifacts and click Compare button.

To deploy this new Custom Metadata Type record, you will need to ensure the custom object it belongs to is also deployed.

The New or Changed artifacts will be shown. Select the Custom Object, Layout, and Custom Metadata to commit to your version control system.

Select the Custom Object, Layout, and Custom Metadata to commit to your version control system.

You can view the content of these files by expanding the down arrow icon. If the file is modified you will see differences between the source and target file side by side to review.

You can view the content of files in the package. If the file is modified you will see differences between the source and target file side by side to review.

Commit to SCM

Create a Package

Once the review of the files is complete, select components to merge to your code base in SCM. Here, we can either give the package name to add the committed files to the package, or we can create a new package from the create package tab.

Give the package name to add committed files to the package.

To create a new package with the committed files, navigate to the Packages tab and click on the create button. This approach will be more useful when the files are committed to your source code directly by developers.

Create a new package from the create package tab to merge to your code base in SCM

After the package is created, add the components to the package as shown below. The components can be searched with the file names or with the commit revision id of the repository. The revisions/files are added to the package by clicking the save button.

After the package is created, add the components to the package.

Build the Package

After the package is ready, click on the build icon to submit the build request. The build operation will extract the files that are part of the package. FlexDeploy creates an Artifact that will be used to deploy to other environments.

FlexDeploy creates an Artifact that will be used to deploy to other environments.

Deploy the Package

After the build is successful, click on the deploy icon to submit a deploy request. This deploys the custom metadata type to the destination Org. This is the manual deployment, most of the time you would use the release pipeline to deploy changes to destination Orgs.

After the build is successful, click on the deploy icon to submit a deploy request. This deploys the custom metadata type to the destination Org.

Conclusion

Custom metadata types are deployable and configurable artifacts containing data values. They are different from other artifacts like objects, fields, or apex classes as they are a combination of data and metadata in Salesforce. FlexDeploy supports Continuous Integration with your development Salesforce org. You can use fully automated pipelines to migrate these changes or you can review as described in this blog and deploy. FlexDeploy can perform a smooth deployment of custom metadata types from one Salesforce environment to another environment, ensuring a robust DevOps process.

Related Resources

Enhancing DevOps Efficiency for Oracle Fusion Cloud Applications with FlexDeploy

Managing Oracle Fusion Cloud applications can be a daunting task, given the vast number of configurations and the need for ...

Streamlining Oracle E-Business Suite with FlexDeploy

Oracle E-Business Suite (EBS) remains a critical component for many organizations, yet managing it comes with its own set of ...

DevOps Assessment for Your Enterprise Software Technologies

In the fast-paced world of Enterprise IT, staying ahead means constantly evolving. For organizations utilizing Oracle, Salesforce, or SAP, the ...

Join DevOps leaders across the globe who receive analysis, tips, and trends in their inbox