Virtual entities is a powerful feature that can be used not only to bring data from external sources, but also from inside Dynamics CRM/Dynamics 365 Customer Engagement.
Jason Lattimer already has a post (https://jlattimer.blogspot.com.au/2017/12/creating-custom-virtual-entity-data.html) that goes through how to setup the custom datasource/data provider. So, go and read that first as it has all the screenshots and I would be duplicating the content, if I go through the steps again.
There is a exception when you create the datasource.
You can simply ignore this and refresh the Plugin Registration tool.
Gotcha 2: If you don’t want the user the open up an individual record, you don’t have to implement Retrieve message. It is optional. Since, I just want a collated entity, I did not register any plugin for the Retrieve.
Gotcha 3: You have to open up the newly created Data Provider entity, and enter the external name. If you don’t enter this, you will be unable to create the data source, as it will always error out.
Objective: MRU items should be accessible from Advanced Find. As an Administrator, I would like to query this data, and see metrics around user participation, entity usage, activity by week/month/year etc.
This is the Most Recently Used area.
This is the Advanced Find on the virtual entity, which is driven by the same data.
As you can see, the data matches up. All the heavy lifting is done by the plugin, that retrieves the records from the “UserEntityUISettings” entity, parses the XML, sorts by user and accessed on and then populated the virtual entity “Recent Items”.
You can query by “Type Equals”, “User Equals” and “User Equals Current User”.
I can also do a PowerBI report that is driven by the same virtual entity.
Source code -> https://github.com/rajyraman/Recent-Items-Virtual-Entity
Managed Solution -> https://github.com/rajyraman/Recent-Items-Virtual-Entity/releases
I hope this helps people to use virtual entities to retrieve data from inside CRM as well – a sort of collation mechanism for reporting.
Reblogged this on Nishant Rana's Weblog and commented:
Awesome post on usage of Virtual Entities
[…] } }); }); }); 18 May 2018 11:53 AM Originally posted on Dreaming in CRM: Virtual entities is a powerful feature that can be used not only to bring data from external […]
Thanks for sharing @Natraj.
[…] Virtual Entities for tracking recently used items: https://dreamingincrm.com/2018/05/19/virtual-entities-for-tracking-recently-used-items/ […]
With Custom provider route , how does the data in virtual entity refresh or is it that when we make calls to retrieve data on demand , the plugin triggers and retrieves the data as requested ? Also , for the data that is residing on SQL on premise , how do we make it work ?
It retrieves the data only when you request it. If your data source is an OnPrem VM, then you need to handle the auth part – probably data gateway or Azure Arc, is what I think, but I haven’t tried it.