CustomMetadata クラス
名前空間
使用方法
Metadata.CustomMetadata を使用して、Apex のカスタムメタデータ型のレコードを表します。詳細は、『メタデータ API 開発者ガイド』の「カスタムメタデータ型」を参照してください。
例
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);