Definition
A Custom Metadata Type in Salesforce is a framework for creating custom, deployable, and packageable application metadata. Unlike Custom Settings (which store data), Custom Metadata Type records are treated as metadata and can be deployed between environments using Change Sets, packages, and the Metadata API. They are ideal for storing application configuration, mapping tables, and business rules that need to move with the application.
Real-World Example
Consider a scenario where a developer at Quantum Labs is working with Custom Metadata Type to build a custom solution that extends the platform beyond its standard capabilities. They write clean, bulkified code for Custom Metadata Type, add comprehensive test coverage, and deploy it through a CI/CD pipeline. The new functionality handles 10,000 records without hitting governor limits.
Why Custom Metadata Type Matters
A Custom Metadata Type is a framework for creating custom, deployable, packageable application metadata in Salesforce. You define a Custom Metadata Type in Setup much like you'd define a custom object, giving it fields and records. The key difference from Custom Settings is that Custom Metadata Type records are themselves treated as metadata. They can be retrieved via the Metadata API, included in Change Sets, shipped inside managed or unlocked packages, and promoted through CI/CD pipelines right alongside code.
This makes Custom Metadata Types the right choice for configuration data that needs to move with the application: mapping tables, business rule thresholds, integration endpoint URLs, feature flags, and lookup data. They're also queryable from Apex, Formula fields, Validation Rules, and Flows, so your code and automation can read the values without hardcoding. The main limits to know are that you generally update Custom Metadata records through deployments rather than runtime writes, and there are governor limits around how many you can query in a transaction. For anything that should be managed as code-adjacent configuration rather than runtime data, Custom Metadata Types are the modern answer.
How Organizations Use Custom Metadata Type
- •Quantum Labs — Stores integration endpoint URLs and credentials references in a Custom Metadata Type. When they deploy to a new environment, the endpoint metadata deploys with the code, so there's no manual Setup step after deployment.
- •TerraForm Tech — Built a business rules engine backed by Custom Metadata Type records. Each rule (threshold, condition, action) is a metadata record, so changes to rules go through their normal Git and CI/CD process with full audit trail.
- •CodeBridge — Uses Custom Metadata Types for feature flags. Flipping a feature on or off happens through a metadata deployment rather than a database update, keeping production changes traceable and reversible.
