Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Entity wise User Statistics Report using FetchXML and SSRS for Dynamics 365 Online Version

Posted on by 260

Hi All,

I have to create a Entity wise User Statistics report using FetchXML and SSRS. I am using Dynamics 365 CRM Online. The Report could be in below format :

User

Activity(Entity)

Total number of records Created

User 1

Entity 1

10

Entity 2

7

3

5

11

14

No

 

 

 

User 2

Entity 1

6

Entity 2

3

32

1

4

34

Yes

*This post is locked for comments

  • dhawal Profile Picture
    dhawal 260 on at
    RE: Entity wise User Statistics Report using FetchXML and SSRS for Dynamics 365 Online Version

    Hi David, Thanks for the reply Can i use the first fetchxml with aggregate for all the entities to display the report? Can it be designed in the format that i have mentioned in my question?

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Entity wise User Statistics Report using FetchXML and SSRS for Dynamics 365 Online Version

    You can do this solely in FetchXML using aggregates. Here's an example query to count the created leads and opportunities

    <fetch aggregate='true'>
        <entity name='systemuser' > 
           <attribute name='fullname' alias='createdby' groupby='true' /> 
           <link-entity link-type='outer' name='opportunity' from='createdby' to='systemuserid'  >
           <attribute name='opportunityid' alias='opportunity_count' aggregate='countcolumn' /> 
           </link-entity> 
           <link-entity link-type='outer' name='lead' from='createdby' to='systemuserid'  >
           <attribute name='leadid' alias='lead_count' aggregate='countcolumn' /> 
           </link-entity> 
        </entity> 
    </fetch>


    This creates a separate field for each entity count, so in the report you'd have one Row Group on the User, then a separate row for each entity. One drawback of this is that, if you add an extra entity to the query, you'll have to add an extra row to the report

    Another option could be to make use of activity feeds. If you configure this to create a post each time a record is created, then you could query the post entity, and use the regardingobjectid and createdonbehalfby columns:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="post">
        <attribute name="postid" />
        <attribute name="createdon" />
        <attribute name="createdonbehalfby" />
        <attribute name="text" />
        <attribute name="regardingobjectid" />
      </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

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans