1. I have a fetchXml query below
string fetchXml1 = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='10'><entity name='account'><attribute name='ownerid' /><attribute name='name' /><attribute name=""creditonhold""/><attribute name='new_onholdstatus'/> <attribute name='accountnumber' /><attribute name='accountid' /><order attribute='accountnumber' descending='true' /><link-entity name='systemuser' to='owninguser'><attribute name='systemuserid'/><attribute name='domainname' /><attribute name='fullname' /></link-entity></entity></fetch>";
2. retrieving Fetch Expression
EntityCollection fxResult1 = _orgService.RetrieveMultiple(new FetchExpression(fetchXml1));
3. extracting records
foreach (var e in fxResult1.Entities) { AliasedValue _sytemuser = (AliasedValue)e.Attributes["owninguser.domainname"]; string _domainname = _sytemuser.ToString();
4. but it is throwing en exception
Thanks in advance