Hi All,
I'm creating a view to use in dashboard to show distinct count. I'm using FetchXMl Builder in xrmtoolbox, the fetchxml able to show the result correctly. However, when try to view in the dashboard the following error shown. Note that the count is bassed on record in the linked entity.
When I try to use advanced find to display the view, the same error occured. Following is my Fetchxml code
Any advice is much appreciated.
Thanks.
Regards,
Teh
Hi Clofly,
Not sure why my post is using NurNina which is my colleague name.
Anyway, do you have the sample html web resource code to fetch the result? I managed to fix the view to display the distinct value. However, when come to the interactive dashboard, the view is showing differently.
It looks to me this is due to the card form in the entity itself. The region is an option set value in my country entity, that's why the count is showing based on country, not the region as per my view.
Regards,
Teh
Hi NurNina01 and Teh,
(Are you the same person? :) )
I want to correct my answer, returntotalrecordcount attribute is always supported by Dynamics.
The actual reason to cause the issue might be that a fetchXml query with returntotalrecordcount attribute enable will return an extra property: @odata.count,
hence dashboard is not able to read the result.
To test, I ran two different fetchxml:
result when returntotalrecordcount is enabled
result without the attribute(@odata.count is not available)
In a word, you could add a HTML web resource with fetchxml query to dashboard to show distinct count by yourself.
Regards,
Clofly
Hi Clofly,
Looking at the errors, it seem that the system always populate unique key into the view automatically when my fetchxml is not putting that attribute.
In fact, my purpose is to display the distinct count in the tiles views. But it seem like the interactive dashboard doesn't support. Correct?
Thanks.
Regards,
Teh
Hi Teh,
Based on the information you provided, I created a custom entity "new_country" for testing,
and set the entity as a lookup field of Account entity.
As per my understanding, I used Contact entity to refer to your ads_keycontact entity, and new_country entity to "ads_country", thus the relationships of those three entities are contact <-> account (N:1),
account <-> new_country(N:1).
Here is a demo dataset based on your query without aggregation and distinction, and the filter is changed to fullname contains 'Mao':
contact fullname | company country | company region |
Clofly Mao | USA | NA |
Alex Mao | China | Asia |
Admin Mao | Japan | Asia |
Office Mao | Germany | Europe |
Solid Mao | USA | NA |
So the expected of your original Fetchxml query is 3.
If my test is correct, then the reason of your issue would be caused by returntotalrecordcount property.
Having searched many web sites, it seems that the property was only supported in CRM2011, I'm not sure whether this property is still supported by Dynamics 365 for Marketing application.
Because your fetchxml is able to work when I remove returntotalrecordcount. (However, if I keep it, the query still encountered same error in your posted picture even in FetchXMl Builder in xrmtoolbox)
You could replace the original two rows
with another row:
From my test, the modification got the same expected total record as returntotalrecordcount.
Regards,
Clofly
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156