Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

How to fetch data from three different entities using fetch xml query in SSRS reports into one single report.

Posted on by 340

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.

  • Suggested answer
    Sandy Hello Profile Picture
    Sandy Hello 340 on at
    RE: How to fetch data from three different entities using fetch xml query in SSRS reports into one single report.

    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>

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: How to fetch data from three different entities using fetch xml query in SSRS reports into one single report.

    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

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to fetch data from three different entities using fetch xml query in SSRS reports into one single report.

    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.

    pastedimage1605598804899v1.png

    2.select parent entity as your need, then select related entities under ‘Related’, and as the same operation for third entity.

    pastedimage1605598828843v2.png pastedimage1605598834606v3.png

    3.clcik Download Fetch Xml.

    pastedimage1605598968205v4.png

    Also, you can try to use (FetchXml Builder ) xrmtoolbox.

    (1) select one entity.

    pastedimage1605600063440v1.png

    (2) right click entity A, click Add and link-entity, and you can click Select attributes to select fields you need.

    pastedimage1605599797978v6.png

    (3) Result view.

    pastedimage1605599939363v7.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Scosec Profile Picture
    Scosec 95 on at
    RE: How to fetch data from three different entities using fetch xml query in SSRS reports into one single report.

    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

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.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans