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
Ashritha SAshritha S 

Couldnt read Geolocation custom field using metadata API

I got a exception ' System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element displayLocationInDecimal '  while reading a geolocation custom field using metadata api.
Gaurav KheterpalGaurav Kheterpal
Do you mind posting your code snippet?

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.
Ashritha SAshritha S
hi Gaurav , 

here is the code ,

MetadataService.CustomField customFieldExisting = (MetadataService.CustomField) service.readMetadata('CustomField', new String[] { 'FieldCreationTest__c.Test_Geolocation__c' }).getRecords()[0];
System.debug(customFieldExisting.label);
 
vishwak adivishwak adi
instead of 
'FieldCreationTest__c.Test_Geolocation__c'
try

'FieldCreationTest__c.Test_Geolocation__s'