Metadata is something that defines the overall organizational structure. And then if you can create your own,custom types as per your requirements, how good that would be? Hell yeah.!! Post summer 15, you can create your own metadata in Salesforce.
AWESOME.!!!!
Custom metadata is customizable, deployable, packageable, and upgradeable application metadata. A custom metadata type is defined as a custom object and is stored in the objects folder. Custom metadata types have a suffix of __mdt (instead of __c for custom objects). Custom metadata type field names have a suffix of __c, like other custom fields. Custom metadata type field names must be dot-qualified with the name of the custom metadata type to which they belong.
(SOURCE: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custommetadatatypes.htm)
The records of custom metadata types are metadata
This means that, unlike custom objects or custom settings records, the records of custom metadata types can be deployed from a sandbox with change sets or packaged in managed packages. When apps with custom objects and custom settings are deployed, the metadata of those objects (the structure) gets deployed, but the records are left behind. If these are just the sample data, these makes sense. However if you need the data also along with the object structure, then its a 2 step process and you would require to deploy the data separately by using dataloader.
(SOURCE:https://developer.salesforce.com/blogs/engineering/2015/04/custom-metadata-types-ga.html)
You can declare an Apex variable of a custom metadata type like: Threat_Tier__mdt Bronze_Option_A;
where "Threat_Tier__mdt" is the Custom Metadata Type and "Bronze_Option_A" is the custom Apex variable to be used in our code.
EX:
Threat_Tier__mdt [] vacationNames = [SELECT Vacation__c FROM Threat_Tier__mdt];
Suggested Reads:
https://trailhead.salesforce.com/modules/custom_metadata_types
Comments
Post a Comment