What is the difference between Custom Metadata Types and Custom Settings?
Suggested answer
Custom Settings: Store configuration data in an object with a hierarchy (org, profile, user level). Two types: Hierarchy (the most common — user/profile values override org-level) and List (no hierarchy). Accessible via MySettings__c.getInstance(). Data is not deployable as metadata — records are org-specific. Custom Metadata Types (CMT): Configuration data stored as metadata records. Deployable via change sets, packages, and CLI. Records can be packaged and version-controlled. Accessible via SOQL: SELECT Value__c FROM MyConfig__mdt WHERE DeveloperName = 'Setting1'. CMTs are preferred for configuration that needs to travel between sandboxes and production as part of deployment. Custom Settings are preferred for user/profile-specific runtime overrides. CMTs cannot be created/updated via DML in Apex triggers (only in tests or Setup).
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.