How i get the child account information with its address fields under the parent account using Fetch XML.
*This post is locked for comments
Glad to hear that you were able to solve the issue.
Thanks,
Manju
Sorry,
This code is working.
Thanks Manju, it helps me alot.
Given code is showing an error: -
An exception System.FormatException was thrown while trying to convert input value '{Parent Account ID}' to attribute 'account.parentaccountid'. Expected type of attribute value: System.Guid. Exception raised: Expected hex 0x in '{0}'.
This error is displayed in xml compiler, so now what should i do?
Hi Shakti,
Please try this.
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='account'>
<attribute name='name' />
<attribute name='accountid' />
<attribute name='address1_postofficebox' />
<attribute name='address1_name' />
<attribute name='address1_longitude' />
<attribute name='address1_latitude' />
<attribute name='address1_fax' />
<attribute name='address1_country' />
<attribute name='address1_city' />
<order attribute='name' descending='false' />
<filter type='and'>
<condition attribute='parentaccountid' operator='eq' value='{Parent Account ID}' />
</filter>
</entity>
</fetch>
Thanks,
Manju
If found useful, please mark the answer as verified.
Can u show me that how it works or how i do this?
you can use XrmServiceToolKit Javascript library to fetch your data. check that url community.dynamics.com/.../how-to-use-xrmservicetoolkit-javascript-library
You just need to include an <attribute> element for each field you want within the <entity> or <link-entity> element. Note that, if a parent account has multiple child accounts, then you will get one record per child account. Depending on how you process the results, it may be easier to have the child account as the root <entity> element in the fetchXml, and the parent account joined as a <link-entity>
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156