Custom Metadata Types

Development 🟡 Intermediate
📖 4 min read

Definition

Custom Metadata Types is a Setup page for creating and managing custom metadata types, which are similar to custom objects but store configuration data that can be deployed between environments using packages and change sets. Records of custom metadata types are considered metadata rather than data, making them ideal for app configuration.

Real-World Example

A developer at Apex Solutions creates a Custom Metadata Type called "Tax_Rate__mdt" with fields for Country, State, and Rate. She populates it with tax rates for each jurisdiction. The Apex code references these metadata records at runtime to calculate taxes. When the rates change, the admin updates the metadata records and deploys them via a change set, no code changes needed.

Why Custom Metadata Types Matters

Custom Metadata Types is the Setup page in Salesforce where administrators and developers create, configure, and manage Custom Metadata Type definitions and their records. Each Custom Metadata Type is similar to a custom object — it has fields, relationships, and records — but with the crucial difference that its records are metadata rather than data. The Setup page allows you to define the type's fields (supporting text, number, checkbox, picklist, URL, and metadata relationship field types), create records, and manage their deployment properties. API names for Custom Metadata Types end with '__mdt' to distinguish them from custom objects ('__c'), making it immediately clear in code whether you're referencing a metadata type or a data object.

The Custom Metadata Types Setup page is where organizations establish their configuration architecture. Well-designed Custom Metadata Types follow principles similar to good database design — normalized structures, clear naming conventions, and appropriate field types. As organizations adopt this pattern for more use cases, governance of the Custom Metadata Types Setup page becomes important. Teams should document which metadata types exist, who owns them, and what processes reference them. The page also provides visibility into metadata type limits — Salesforce allows up to 200 metadata type definitions per org and 10MB total metadata storage. Organizations building ISV packages should note that Custom Metadata Types can be included in managed packages with protected visibility to prevent subscribers from modifying the records.

How Organizations Use Custom Metadata Types

  • Apex Solutions — Apex Solutions uses the Custom Metadata Types Setup page to manage their 'Tax_Rate__mdt' type with Country, State, and Rate fields. The admin creates and updates records directly in Setup. When deploying to production, the metadata records travel with the change set automatically. The team has established a governance process where all new Custom Metadata Type definitions require architecture review before creation to prevent redundancy.
  • CloudForge Platform — CloudForge Platform manages 12 different Custom Metadata Types through the Setup page, including Feature_Flag__mdt for controlling feature rollouts, Mapping_Config__mdt for field mappings between systems, and Error_Message__mdt for centralized error text. They created a master documentation spreadsheet linked from each metadata type's description field that explains the type's purpose, owning team, and referencing code.
  • Meridian ISV — Meridian ISV uses the Custom Metadata Types Setup page to build configuration types into their managed package. Their 'Scoring_Model__mdt' type allows customers to read the pre-configured scoring parameters but cannot modify them due to protected visibility. The ISV pushes updated scoring models through package upgrades, ensuring all customers receive optimized configurations without any manual intervention.

🧠 Test Your Knowledge

See something that could be improved?

Suggest an Edit