Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

FetchXML report from three different entities

Posted on by Microsoft Employee

I am trying to write a report about Accounts showing all contacts with this Account as parentcustomerid and all positions with this Account. This is for use with Dynamic 365.

I need to go from Accounts with show all Contacts for this  Account and show all Positions for this  Account.

I wrote the following query.

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="account">
<attribute name="name" />
<attribute name="primarycontactid" />
<attribute name="telephone1" />
<attribute name="altai_memberid" />
<attribute name="websiteurl" />
<attribute name="emailaddress1" />
<attribute name="accountid" />
<attribute name="address1_composite" />
<attribute name="fax" />
<order attribute="name" descending="false" />
<filter type="and">
<condition attribute="psats_municipalitytype" operator="eq" value="340970000" />
</filter>
<link-entity name="contact" from="parentcustomerid" to="accountid" visible="false" link-type="outer" alias="Contact">
<attribute name="psats_suffix" />
<attribute name="middlename" />
<attribute name="altai_memberid" />
<attribute name="lastname" />
<attribute name="firstname" />
<attribute name="emailaddress1" />
<attribute name="parentcustomerid" />
</link-entity>
<link-entity name="altai_mbr_position" from="altai_accountid" to="accountid" visible="false" link-type="outer" alias="Positions">
<attribute name="altai_startdate" />
<attribute name="altai_mbr_programid" />
<attribute name="altai_contactid" />
<attribute name="altai_accountid" />
<attribute name="altai_enddate" />
<attribute name="altai_positiontitleid" />
<attribute name="altai_mbr_positionid" />
<attribute name="psats_termexpires" />
<attribute name="statuscode" />
<attribute name="statecode" />
<attribute name="altai_positiongroupid" />
<order attribute="altai_accountid" descending="false" />
<filter type="and">
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="statuscode" operator="eq" value="1" />
</filter>
</link-entity>
<link-entity name="account" from="accountid" to="altai_accountid" alias="ac">
<filter type="and">
<condition attribute="psats_municipalitytype" operator="eq" value="340970000" />
</filter>
</link-entity>
</entity>
</fetch>

When I place this in visual Studio I receive the following error.

The tablix has a detail member with inner members. Detail members can only contain static inner members.

*This post is locked for comments

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: FetchXML report from three different entities

    Use CRMRest builder tool to test your fetch xml query before using in your code

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans