Saturday, January 7, 2017

Custom Metadata Types and Custom Settings Implementation Tricks

Custom Settings

  • Custom settings helps to create custom data set  and associate the data set to particular user, profile or for all users (org-wide). 
  • There are 2 types of custom setting, List and Hierarchy
  • Same set of data is available to all user if we define List custom setting.
  • In Hierarchy custom setting, you can control data visibility based on logged in user, profile or org-wide. 
  • In Hierarchy custom setting for logged in user, system first check user then profile and then org wide setting in order to return data from hierarchy custom setting.
  • You can control the visibility of custom setting by specifying it as public or protected.
  • If custom setting is marked as protected, the subscriber organization will not be able to access the custom setting. If it is marked as public, then subscriber org can also access it.
  • Once you create custom setting, then you cannot change the type (List to hierarchy or vice versa).
  • Custom setting data is available in application cache which increase performance. 
  • You can access custom setting data using instance methods and can avoid SOQL queries to database.
  • While migrating custom setting to another org, you need to migrate data for custom setting separately.
  • Custom settings do not support relationship fields.
  • Custom setting can be used by formula fields, validation rules, flows, Apex, and the SOAP API.
  • You cannot access List custom setting in Validation rule. Only Hierarchy custom setting can be used.
  • In order to use value from list custom setting in validation rule, create a field in object and populate list custom setting value in custom field through triggers and then refer it in validation rule. Validation rule fires after trigger execution.
  • You can perform CUD (Create, Update, Delete) operation on custom setting in apex.
  • Custom settings are not visible in test class without "SeeAllData" annotation.

Custom Metadata Types
  • Custom metadata are like custom setting but records in custom metadata type considered as metadata
  • You can migrate data present in custom metadata type to different org easily. 
  • This helps to create app configuration data and include it in package. 
  • Custom metadata types support Metadata Relationship. It is still in Beta.
  • Metadata Relationship provides the ability to add relationships from your custom metadata to other things in your app, such as other custom metadata, custom or standard objects and fields, and static resources.
  • You can't perform CUD (Create, Update, Delete) operation on custom metadata type in apex.
  • You can also control the visibility of custom metadata type while adding it in package.
  • Custom metadata type are visible in test class without "SeeAllData" annotation.
Custom metadata types are still in development phase and many new features will come in coming future.

Refer Below Links for Salesforce Interview Questions


  1. Awesome blog thanks for sharing While choosing your perfect ride for driving, Accord Cars comes with and the best packages for you to pick from. Car rentals for self drive in Chennai are done the easier. Just pick out your plan from hourly, daily, weekly and even monthly plans available.

  2. Very useful blog thanks for sharing With over a three decade of beauty expertise at our fingertips, we believed that everyone has the right to be beautiful. And so began the journey of our very own Pearl’s Beautician course in Chennai.

  3. Great blog thanks for sharing Looking for the best creative agency to fuel new brand ideas? Adhuntt Media is not just a digital marketing company in chennai. We specialize in revamping your brand identity to drive in best traffic that converts.

  4. Nice blog thanks for sharing Set up a aesthetic work environment that employees love to spend time in and relieve their stress. Your company needs the best corporate gardening service in Chennai and Karuna Nursery Gardens in happy to oblige you in the endeavour to make your infrastructure something worth flaunting about.

  5. Excellent blog thanks for sharing Run your salon business successfully by tying up with the best beauty shop in Chennai - The Pixies Beauty Shop. With tons of prestigious brands to choose from, and amazing offers we’ll have you amazed.

  6. Awesome blog thankks for sharing 100% virgin Remy Hair Extension in USA, importing from India. Premium and original human hair without joints and bondings. Available in Wigs, Frontal, Wavy, Closure, Bundle, Curly, straight and customized color hairstyles Extensions.

  7. Very useful blog thanks for sharing IndPac India the German technology Packaging and sealing machines in India is the leading manufacturer and exporter of Packing Machines in India.

  8. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    CRM Software| CRM System | CRM


  9. You write this post very carefully I think, which is easily understandable to me. Not only this, but another post is also good. As a newbie, this info is really helpful for me. Thanks to you.
    Tally ERP 9 Training
    tally classes
    Tally Training institute in Chennai
    Tally course in Chennai

  10. I feel satisfied to read your blog, you have been delivering a useful & unique information to our vision.keep blogging.
    Digital Marketing Course In Kolkata

  11. IEEE Cloud computing DOamin is a general term for anything that involves delivering hosted services over the Internet. cloud computing projects The cloud projects for cse is a metaphor for a global network of remote servers which operates as a single ecosystem, commonly associated with the Internet. IEEE FInal Year Networking Projects for CSE Domains Networking Projects cloud computing is the delivery of computing projects services—including servers, storage, databases, networking projects, software, analytics, and intelligence

    JavaScript Training in Chennai

    JavaScript Training in Chennai

  12. A couple of the numerous unobtrusive changes that might be found on packaging machines of a similar sort are portrayed beneath to all the more likely comprehend the LPS meaning of custom packaging hardware.


  13. Thanks, this is generally helpful.
    Still, I followed step-by-step your method in this salesforce cpq online training Hyderabad
    Learn salesforce cpq

  14. Thanks for sharing the way to make instant reach towards the customers can be achieved by PPC services, where Pingu provides the value for each and every bid of investment into productive one as a PPC service provider in Chennai.