web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Michel van den Brink Profile Picture
    4,697 on at

    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 :-)

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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>

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans