Custom Metadata type in salesforce

Custom Metadata Type let you use records to configure your app without worrying about migrating those records to other orgs. You can deploy the records of custom metadata types from a sandbox with change sets or packaged in managed packages instead of transferring them manually.

With Custom Metadata Types, you can customize, deploy, package, and upgrade application metadata that you design yourself.

When you create Custom Metadata Type, you also create custom fields on that type. Custom meta data support below field types.

  • Metadata Relationship
  • Checkbox
  • Date and Date/Time
  • Email and Phone
  • Number
  • Percent
  • Picklist
  • Text and Text Area
  • URL

How to create Custom Metadata types?

To create, go to setup -> Custom Metadata Types and click on new custom metadata types button.

Fill required details.

Custom Metadata Types 1

Custom metadata type api name ends with “__mdt”.

After creating this, you will get an option to create fields, layout and validation rules.

Once you are done with you can create records like custom setting. And you can use this in Apex.