What is Custom Metadata in Salesforce in 2023?

Metadata is data that describes other data.  for instance, in Salesforce org, there’s a standard object called Account.  Once you add a record with a customer’s contact information to an Account, you add metadata and data.  

What is a Custom Metadata Type?

A custom metadata type is an object that’s used to define the structure for application metadata. The fields of custom metadata types, and therefore the values in the fields, consist only of metadata. The records of custom metadata types also are metadata, not data.

When you deploy apps with custom metadata types, all of the records and fields are included within the package installation, so no additional steps are needed.  you’ll deploy custom metadata types from a sandbox with change sets or packaged in managed packages.

Don’t forget to check out: Visualizing Salesforce Metadata: Understanding the Relationships with AbstraLinx ERDs

Use Cases for Custom Metadata Types

  1. Mappings: You can use custom metadata types to make associations between different objects, for instance, you’ll create a custom metadata type that assigns cities, states, or provinces to particular regions in a country.  
  2. Business rules: Salesforce has plenty of ways to define business rules.  A method is to combine configuration records with custom functionality, for instance, you’ll use custom metadata types along with some Apex code to route payments to the correct endpoint.  
  3. Master data: Say that your org uses a typical accounting app. You’ll create a custom metadata type that defines custom charges, like duties and VAT rates. If you include this sort as part of an extension package, subscriber orgs can reference this master data.  
  4.  Protected information: Store data like API keys during a protected package.  

Custom Metadata supports most traditional filed types including the following 

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

Support To Developer  

  • Developers can use SOQL to read custom metadata types.  
  • To create or update metadata records, they will use the Metadata API.   
  • Apex code can create, read, and update (but not delete) custom metadata records.  

Custom metadata types are often used directly from:  

  • Apex   
  • Flows   
  • Formula fields  
  • Process Builder  
  • Validation rules  

dont miss out iconCheck out another amazing blog here: What are Aura Components in Salesforce? | The Ultimate Guide

Conclusion  

Custom metadata types are customizable, deployable, packageable, and upgradeable application metadata.  

In many cases, custom metadata types have a plus over custom settings and custom objects.   

They can make your application lifecycle management and compliance easier, faster, and more robust.   

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *