-1

I have gone through various articles for the difference between Custom Setting and Custom Metadata but I couldn't find the major difference why we should setting over metadata or metadata over setting.

Can anyone please help me with this?

2
  • Hi. Please read How to Ask then edit your question to show your research, including specific information and references. Honestly, this sounds like an interview question and something easy to answer for yourself with a bit of effort.
    – Phil W
    Commented Sep 16, 2023 at 9:42
  • Hi,I have done my research very well and couldn't find the key difference between the two.I know there are many differences but didn't know the one that makes you choose between any of them.
    – Hira Khan
    Commented Sep 16, 2023 at 13:12

1 Answer 1

3

Custom Setting and Custom Metadata is similar to Custom Object. Here is some difference. More details you can use references.

Custom Setting

  • It has suffix __c same as Object
  • Data not visible in Test Classes, Need to create data if required or add SeeAllData annotation in Test Class
  • You can perform CUD (Create, Update, Delete) in Apex
  • Custom Setting not supported relationship field
  • You cannot deploy data using Metadata API/Package/Change Set

Custom Metadata

  • It has suffix __mdt same as Object
  • Data visible in Test Classes without the SeeAllData annotation
  • You cannot perform CUD (Create, Update, Delete) operation on custom metadata type in apex
  • You can create lookup relationship between two Metadata
  • You can deploy data using Metadata API/Package/Change Set

Reference

https://www.biswajeetsamal.com/blog/difference-between-custom-settings-and-custom-metadata-types/

https://www.apexhours.com/difference-between-custom-setting-and-custom-metadata-salesforce/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .