Announcements
No record found.
How i get the child account information with its address fields under the parent account using Fetch XML.
*This post is locked for comments
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>
you can use XrmServiceToolKit Javascript library to fetch your data. check that url community.dynamics.com/.../how-to-use-xrmservicetoolkit-javascript-library
Can u show me that how it works or how i do this?
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.
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?
Sorry,
This code is working.
Thanks Manju, it helps me alot.
Glad to hear that you were able to solve the issue.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.