Hi,
I'm trying to get the option set label from the fetchXML query with no luck.
I've read many posts and tried different ways to retrieve the option set values that are aggregated (group by) in the fetchXML.
Below is my query.
var strQuery = $@" <fetch aggregate='true'> <entity name='custasset'> <attribute name='name' alias='totalCount' aggregate='count' /> <attribute name='field1' alias='sv' groupby='true' /> <attribute name='field2' alias='shv' groupby='true' /> <attribute name='field3' alias='rg' groupby='true' /> <filter type='and'> <condition attribute='field1' operator='not-null' /> <condition attribute='field2' operator='not-null' /> <condition attribute='field3' operator='not-null' /> </filter> </entity> </fetch>";
Here is the casting that I tried to get the label. It doesn't even give the option set value.
1. String optValue = (String)((AliasedValue)c["shv"]).Value; 2. String optValue = c.GetAttributeValue<String>("sv");
It would be a great help if anyone suggest/guide on how to do this.
Thanks,
Sandip
*This post is locked for comments