Custom Metadata Types

What are Custom Metadata Types?

Custom Metadata Types are a form of application metadata in Salesforce that is customizable, deployable, packageable, and upgradeable. They define the structure of custom metadata rows, resembling custom object rows, and are used to build reusable functionality that determines behavior based on metadata of that type. Custom Metadata Types can be applied for various purposes, such as mappings, business rules, primary data, and allowlists, and are read-only in the Enterprise and Partner APIs.

Benefits of Using Custom Metadata

  • Reusable functionality: Custom Metadata Types enable developers to build apps defined and driven by their own types of metadata, creating reusable functionality.
  • Simplified Apex code: They reduce the need for manually filled fields, ensuring referential integrity by referencing objects.
  • Efficiency gains: Advanced formula fields using custom metadata types make it easier to update values without changing multiple hard-coded formulas.
  • Easy deployment: Custom Metadata Types can be packaged and installed in various Salesforce editions, making them easily deployable and reusable across different organizations.
  • Improved data management: They facilitate the creation of associations between different objects, combine configuration records with custom functionality, and manage lists such as approved donors and preapproved vendors.

Creating and Managing Custom Metadata

Creating custom metadata in Salesforce involves a two-step process.

  • Create a custom metadata type: Define the form of the application metadata.
  • Build reusable functionality: Determine the behavior based on metadata of that type.
  • Manage records: Custom metadata records can be created, edited, and deleted using Metadata API or in Setup.
  • Migrate records: Use packages or Metadata API tools for easier management.

When using custom metadata, follow best practices such as using them for mappings, business rules, primary data, and allowlists. Combine configuration records with custom functionality for better results. Be aware of common mistakes, such as:

  • Not using relationships to directly reference objects.
  • Not updating field values in custom metadata types instead of updating multiple field references.
  • Not being aware of special behaviors and limitations when using custom metadata types.

Custom Metadata vs. Custom Settings

When deciding between Custom Metadata and Custom Settings in Salesforce, it's essential to understand their differences and use cases. Custom Metadata is metadata, while Custom Settings are data. Custom Metadata records are read-only in the Enterprise and Partner APIs, whereas Custom Settings can be modified. Additionally, Custom Metadata can be migrated using packages or Metadata API tools, while Custom Settings cannot.

Custom Metadata Types are customizable, deployable, packageable, and upgradeable, allowing for the creation of reusable functionality based on metadata. They can be used for various purposes, such as mappings, business rules, primary data, and allowlists. On the other hand, Custom Settings provide a way to store custom data that can be accessed and modified by users. They can be used to store data specific to an organization or user and can be accessed and modified using the Enterprise and Partner APIs.

Practical Applications of Custom Metadata

Practical applications of Custom Metadata Types in Salesforce can be found across various industries and use cases. Some examples include:

  • Mappings: Creating associations between different objects, such as assigning cities, states, or provinces to specific regions in a country.
  • Business rules: Combining configuration records with custom functionality, like using custom metadata types and Apex code to route payments to the correct endpoint.
  • Primary data: Defining custom charges, such as duties and VAT rates, for a standard accounting app using custom metadata types.
  • Allowlists: Managing lists, such as approved donors and preapproved vendors.
  • Secrets: Storing information like API keys in protected custom metadata types within a package.

Other terms

Oops! Something went wrong while submitting the form.
00 items

Email Marketing

Email marketing is the act of sending commercial messages, typically to a group of people, using email to promote a business's products or services, incentivize customer loyalty, and enhance brand awareness.

Read more

Inventory Management

Inventory management is the process of ordering, storing, using, and selling a company's inventory, which includes the management of raw materials, components, and finished products, as well as warehousing and processing of such items.

Read more

80/20 Rule

The 80/20 Rule, also known as the Pareto Principle, asserts that 80% of outcomes result from 20% of all causes for any given event.

Read more

A/B Testing

A/B testing is a method for comparing two versions of a webpage or app to determine which one performs better based on statistical analysis.

Read more

ABM Orchestration

ABM Orchestration involves coordinating sales and marketing activities to target specific high-value accounts effectively.

Read more

AI Sales Script Generator

An AI Sales Script Generator is a tool that utilizes artificial intelligence, specifically natural language processing (NLP) and generation (NLG), to create personalized and persuasive sales scripts for various communication channels, such as video messages, emails, and social media posts.

Read more

AI-Powered Marketing

AI-powered marketing uses artificial intelligence technologies to automate and enhance marketing strategies.

Read more


An API, or Application Programming Interface, is a mechanism that enables two software components to communicate with each other using a set of definitions and protocols.

Read more

Accessibility Testing

Accessibility testing is the process of evaluating web and mobile applications to ensure they are easily usable by people with disabilities, such as visual, hearing, mobility, and cognitive impairments.

Read more


In a sales, an account refers to a customer or organization that purchases goods or services from a company.

Read more

Account Click Through Rate

Account Click Through Rate (CTR) is a metric that measures the ratio of how often people who see an ad or free product listing end up clicking on it.

Read more

Account Development Representative

An Account Development Representative (ADR) is a specialist who works closely with a company's most important clients to build long-lasting, strategic partnerships.

Read more

Account Executive

An Account Executive is an employee responsible for maintaining ongoing business relationships with clients, primarily found in industries like advertising, public relations, and financial services.

Read more

Account Management

Account management is the daily management of client accounts to ensure they continue to do business with a company, focusing on showing clients the value they can enjoy if they continue to use the company's products or services.

Read more

Account Mapping

Account mapping is a strategic process that involves researching and visually organizing key stakeholders, decision-makers, and influencers within a target customer's organization.

Read more

Account Match Rate

An Account Match Rate is a measure of a vendor's ability to match IPs and other digital signals to accounts, which is essential for account-based sales and marketing.

Read more

Account View Through Rate

Account View Through Rate (AVTR) is a metric that measures the percentage of individuals who watch a video advertisement to the end, providing insights into the ad's effectiveness.

Read more

Account-Based Advertising

Account-Based Advertising (ABA) is a specialized component of Account-Based Marketing (ABM), focusing on targeting and engaging specific high-value accounts with personalized campaigns.

Read more

Account-Based Analytics

Account-Based Analytics is a method and toolset used to measure the quality and success of Account-Based Marketing (ABM) initiatives.

Read more

Account-Based Everything

Account-Based Everything (ABE) is the coordination of personalized marketing, sales development, sales, and customer success efforts to drive engagement with, and conversion of, a targeted set of high-value accounts.

Read more
Clay brand asset shaped as a 3D group of abstract objects made out of purple and pink clayClay brand asset shaped as a 3D group of abstract objects made out of purple and pink clay

Scale your outbound motion in seconds, not months

14 day free Pro trial - No credit card required

Try Clay free