// Set up custom metadata to be created in the subscriber org. Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); customMetadata.fullName = 'ISVNamespace__MetadataTypeName.MetadataRecordName'; Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue(); customField.field = 'customField__c'; customField.value = 'New value'; customMetadata.values.add(customField);
When you assign namespaces to records, provide full, qualified record names to the app. If both the type and the record are in Namespace, use something like: customMetadata.fullName = 'Namespace__MetadataTypeName.Namespace__MetadataRecordName'
The following are properties for CustomMetadata.
public List<Metadata.CustomMetadataValue> values {get; set;}
Type: List<Metadata.CustomMetadataValue>
The following are methods for CustomMetadata.