Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Dynamics 365 FetchXML SRSS Report creation link-entity attributes name mangling

Posted on by Microsoft Employee

Hi everyone,

I've been struggling trying to get this to work and haven't stumbled across any posts or blogs with the same issue so here it goes. I'm trying to simply use link-entity and gather some attributes for the linked entity which seems to work just fine in Visual Studio. While setting up the DataSet, I clicked the Query Designer and exclamation point icon to see the results and all the data is there as expected, no issues. The issue is after I've clicked OK, the attribute names for my linked entity get a random generated ID inserted into the middle of the name. Obviously, visual studio is doing this for a reason, seems to be some sort of session ID when fetching the results because clicking Refresh Fields in the DataSet properties will generate a new ID each time. The problem is, when I try to insert these fields in my report and preview the report, I get no data for these generated named copies of my fields, as well as the rsMissingFieldInDataSet warning, which makes sense because the generated field names aren't my actual field names. I also get these 2 warnings - The data extension returned an error during reading the field. There is no data for the field at position # and also - Warning [rsMissingFieldInDataSet] The dataset ‘DataSet1’ contains a definition for the Field ‘my_field_nameRANDOM_ID_INSERTED’. This field is missing from the returned result set from the data source. My original entity attributes still display fine and dont get their names changed, only the linked entity names get mangled. I'm trying to build this custom fetchxml report so I can view it in Dynamics 365 online. Thanks for any help.

*This post is locked for comments

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Dynamics 365 FetchXML SRSS Report creation link-entity attributes name mangling

    Hi ,

    Here is sample fetch XML with link entity. Use same like this - Hope this helps

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
      <entity name="new_postalcode">
        <attribute name="new_postalcodeid" />
        <attribute name="new_name" />
        <attribute name="createdon" />
        <order attribute="new_name" descending="false" />
        <link-entity name="new_country" from="new_countryid" to="new_pcountry" alias="ac">
          <filter type="and">
            <condition attribute="new_countryid" operator="eq" uiname="NOUVELLE-CALEDONIE" uitype="new_country" value="{2CF9EBD6-0575-E611-80E3-0050560111FF}" />
          </filter>
          <link-entity name="new_city" from="new_countryid" to="new_countryid" alias="ad">
         
            <filter type="and">
              <condition attribute="new_cityid" operator="eq" uiname="NOUMEA" uitype="new_city" value="{381B1F7C-404F-E711-8103-000C29CBC14A}" />
            </filter>
          </link-entity>
        </link-entity>
      </entity>
    </fetch>
  • Verified answer
    Michel van den Brink Profile Picture
    Michel van den Brink 4,697 on at
    RE: Dynamics 365 FetchXML SRSS Report creation link-entity attributes name mangling

    Hello,

    This would occur when your link-entity element does not have an alias attribute.

    To avoid duplicate column names (which might occur when joining entities, because there are several fields with the same name in several entities) Visual Studio adds a self generated alias, which happens to be a big ugly number.

    Adding an alias attribute yourself will force Visual Studio to use your alias, rather than those self generated numbers.

      

    Try adding an alias. For example:

    <link-entity name="phonecall" from="activityid" to="objectid" link-type="inner" alias="phonecall1">


      

    Hope this helps you. If you have any other questions, please let me know!

    If you found my answer helpful, please help the community by marking it as verified :-)

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans