Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

How to get the AliasedValue records returned from FetchXml CRM 2011

$
0
0

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



Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>