Created
October 18, 2018 13:37
Star
You must be signed in to star a gist
Anon.apex to convert custom object records into custom metadata records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MD.updateAndDeployMetadata( | |
[ SELECT Field1__c, Field2__c, Field3__c, Field4__c FROM Object__c ], | |
CustomMetadata__mdt.sObjectType, | |
new Map<SObjectField, SObjectField>{ | |
Object__c.Field1__c=> CustomMetadata__mdt.Field1__c, | |
Object__c.Field2__c=> CustomMetadata__mdt.Field2__c, | |
Object__c.Field3__c=> CustomMetadata__mdt.Field3__c, | |
Object__c.Field4__c => CustomMetadata__mdt.Field4__c | |
}, | |
'X+Field1__c+_+Field2__c', | |
'Field3__c+ +Field4__c ' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/Patlatus/53ce49fde265c0aa3d0f2c3fdda8b900