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
SurekaSureka 

Invalid conversion from runtime type MetadataService.Metadata to MetadataService.ValidationRule

Hi,

I am reading the Metadata of Validation Rules using the following:

MetadataService.ReadResult resultValue = service.readMetadata('ValidationRule',fullNames);

The above statement works fine and returns the results. 

Now how do I get to read the individual validation rules? If I try to parse(MetadataService.ValidationRule vr = (MetadataService.ValidationRule)md;), it is giving the following exception:

Invalid conversion from runtime type MetadataService.Metadata to MetadataService.ValidationRule

Any Idea?? 
Thanks