You need to sign in to do that
Don't have an account?
![Phuc Nguyen 18 Phuc Nguyen 18](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Apex mapping of mdt
Hello,
I would like to covert my list of mdt records to use a map.
Her eis the current state
how can I change List<PriceSelection__mdt> into a map
Thank you,
P
I would like to covert my list of mdt records to use a map.
Her eis the current state
List<PriceSelection__mdt> priceBooks = [SELECT Id, PriceId__c, Service__c, DeveloperName, Customer__c, ProjectManager__c from PriceSelection__mdt]; for(SObject so : Trigger.New){ Project__c newProj = (Project__c) so; if(priceBooks.size() > 0){ for (PriceSelection__mdt pbs: priceBooks ){ if(newProj.Service__c == pbs.Service__c && newProj.Customer__c == pbs.Customer__c && newProj.Project_Manager__c== pbs.ProjectManager__c){ newProj.PriceBook__c = pbs.PriceId__c; }
how can I change List<PriceSelection__mdt> into a map
Thank you,
P
https://salesforce.stackexchange.com/questions/293789/custom-metadata-to-map
https://salesforce.stackexchange.com/questions/293789/custom-metadata-to-map
'
https://developer.salesforce.com/forums/?id=906F0000000BXkJIAW
Thanks!