+ 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