function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prakhyat sapraPrakhyat sapra 

how can i code for call this custom metadata in the apex class???

how can i code for call this custom metadata in the apex class???User-added image
mukesh guptamukesh gupta
Hi Prakhyat,

Please follow below code:-
 
//Get custom metadata with getAll
Map<String, OmdbSearchBox__mdt> mapEd = OmdbSearchBox__mdt.getAll();
for(String param : mapEd.keySet()){
    System.debug('API KEY ----->'+mapEd.get(param).API_Key__c);
	System.debug('End Point  ----->'+mapEd.get(param).Endpoint__c);
	System.debug('Method ----->'+mapEd.get(param).Method__C);	
}

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
Prakhyat sapraPrakhyat sapra
I have to create the wrapper class & change the endpoint too so how can I???