Announcements
I want to fetch data from three different entities, say e.g. Entity C is child to Entity B and B is child to Entity A, I want to fetch data using fetch xml query from all the three different entities in to one single report, how can this be achieved.
Thanks Leah for your response advance find option helped me to fetch query for all the three entities together, but i have not used any xrmtoolbox here. Below code helped me.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="A">
<attribute name="X" />
<link-entity name="B">
<attribute name="Y" />
<link-entity name="C">
<attribute name="Z" />
</link-entity>
</link-entity>
<filter type="and">
</filter>
</entity>
</fetch>
In addition with above suggested answer, create link entity relation in advance find and once you download it then change inner to outer in xml relationship
Hi Sandy,
You can use Advanced Find to build fetch xml and download it, which is easy.
As you mentioned, Entity C is child to Entity B and B is child to Entity A.
1.Go Advanced Find.
2.select parent entity as your need, then select related entities under ‘Related’, and as the same operation for third entity.
3.clcik Download Fetch Xml.
Also, you can try to use (FetchXml Builder ) xrmtoolbox.
(1) select one entity.
(2) right click entity A, click Add and link-entity, and you can click Select attributes to select fields you need.
(3) Result view.
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Hi Sandy,
You can create a <link-entity> inside your fetchxml to join related entities.
Also you could choose to install the XRM toolbox. There is a FetchXML builder that makes it pretty easy to select the appropiate data.
Link: https://www.xrmtoolbox.com/
Microsoft docs: docs.microsoft.com/.../use-fetchxml-construct-query
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156