Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
CustomMetadata Class
Namespace
Usage
Use Metadata.CustomMetadata to
represent records of custom metadata types in Apex. For more information, see Custom Metadata Types in the
Metadata API Developer Guide.
Example
1// Set up custom metadata to be created in the subscriber org.
2 Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata();
3 customMetadata.fullName = 'ISVNamespace__MetadataTypeName.MetadataRecordName';
4
5 Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue();
6 customField.field = 'customField__c';
7 customField.value = 'New value';
8
9 customMetadata.values.add(customField);CustomMetadata Properties
The following are properties for CustomMetadata.
values
Signature
public List<Metadata.CustomMetadataValue> values {get; set;}
Property Value
Type: List<Metadata.CustomMetadataValue>