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>