What are Custom Meta and Custom Settings in Salesforce?

  • Custom Metadata & custom settings

In this series of blogs and articles, Cloudely experts simplify Salesforce concepts. You can find Salesforce interview questions and answers, real-time scenarios, use cases, errors, turnarounds, answers to our reader’s queries and more. We hope you will find it helpful.

What is Custom Metadata in Salesforce?

What is custom metadata?

We can store some repetitive used data like usernames, credentials in metadata and fetch it in our apex class without hardcoding them.

What is the advantage of custom metadata?

We can fetch the custom metadata without writing any SOQL query unlike any other list data.

Can we deploy custom metadata?

Yes, we can deploy custom metadata records.

How can we see the custom metadata types?

Custom metadata types are visible in test class without “SeeAllData” annotation.

Can we perform CUD on custom meta data?

We cannot perform CUD (Create, Update, Delete) operation on custom metadata type in apex.

How can we control the visibility of custom metadata?

We can control the visibility of Custom Metadata Types by specifying it as public or protected. If custom metadata is marked as public type, then anyone can see it. Else, if it is marked as protected type, in the installed managed package subscriber organization, only Apex code in that managed package can use it.

Also Read: Salesforce Interview Questions Part 1

What are Custom Settings in Salesforce?

In Salesforce, we have 2 types of custom settings:

  • List
  • Hierarchy

 

  • We can control the visibility of custom settings by specifying it as public or protected.
  • We can fetch custom setting data with the help of instance methods avoiding SOQL queries to the database.
  • While migrating custom settings to another org, we can deploy only the metadata, we need to upload data into the custom setting post deployment.
  • We cannot access List custom settings in the Validation rule. Whereas Hierarchy custom setting can be used.
  • We can perform CUD (Create, Update and Delete) operation on custom settings in apex.
  • Custom settings are not visible in test class without “SeeAllData” annotation.

Also Read: What is Bulkification?

Think Salesforce, Think Cloudely 

At Cloudely, we deliver everything Salesforce. Implementations, Support, Managed Services, Training and Staffing – Think Cloudely for your Salesforce A-Z requirements.

Explore our online Salesforce training programs.

Found this article informative? Share this article.

Looking for expert answers to Salesforce questions? Send them to salesforce@cloudely.com. Our Salesforce experts will answer your doubts.

Bindu Kaperla is a Senior Salesforce Developer at Cloudely.

By |2023-02-14T17:44:44+05:30February 14th, 2023|Comments Off on What are Custom Meta and Custom Settings in Salesforce?