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
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>
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 :-)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156