Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to write fetch xml in reports to relate three entities,entity A is lookup for entity B and entity C

Posted on by 340

How to relate these three entities where entity A is lookup in both entity B and entity C. And get the detail information by retrieving fields from all the three entities 

*This post is locked for comments

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,397 on at
    RE: How to write fetch xml in reports to relate three entities,entity A is lookup for entity B and entity C

    Hi

    Use XrmToolBox

    Example fetchXml:

    <fetch top="50" >
      <entity name="account" >
        <attribute name="address1_city" />
        <attribute name="name" />
        <attribute name="accountnumber" />
        <filter>
          <condition attribute="createdon" operator="last-x-days" value="90" />
        </filter>
        <link-entity name="contact" from="parentcustomerid" to="accountid" alias="cont" >
          <attribute name="gendercode" />
          <attribute name="lastname" />
          <attribute name="firstname" />
        </link-entity>
        <link-entity name="opportunity" from="customerid" to="accountid" alias="Opp" >
          <attribute name="actualvalue" />
          <attribute name="name" />
          <attribute name="totalamount" />
        </link-entity>
      </entity>
    </fetch>


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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans