Plugin In Statistics in CRM 2016/ Dynamics 365

Problem Statement

 

Some time there is a requirement from client to highlight the usage of customization done in the form of Plugin assembly or a custom workflow. On several occasions, when Plugin is making a call to an external Web client, they may also like to monitor the number of such calls or the number of times it was successful or failure.

Solution

Microsoft Dynamics have added an internal entity “Plug-in Type Statistics”. It could be seen in the advanced find filter. Mentioned below is a sample screenshot of what information in presents

As shown in the above example, Assembly name, execution count, failure count, failure percent etc are some of the information that is available.

plugin-statistic1

The same view can also be embedded in a chart or a dashboard for better visualization.

plugin-statistic2

Advertisements

Azure Logic Apps Twitter to Facebook

Several Logic Apps have been provided in Azure to provide integration between different applications.

In once such Logic Apps, we can integrate tweets happening in twitter with that of the Facebook account. Mentioned below screenshots illustrate how this is configured

logicapp1

LogicApp2.png

After the logic app has been created, navigate to the Logical App Designer

logicapp3

Select the app which provides integration between twitter and Facebook

logicapp4

logicapp5

After the template is selected, the App will ask for account details of both twitter and facebook.

logicapp6

 

logicapp7

 

Tweets can be filtered based upon the text present in the tweet. Along with that, there are also several different conditions based upon which we can filter the tweet. There is an if else condition expression present which allows us to drill down to several properties of the tweet.

logicapp8

logicapp10

logicapp9

 

 

Setting Activity Party field in Email in JavaScript

There seems to be a change in the way we used to populate Activity Party fields in an email. Other than the id, name, entitytype we now also need to pass object code for the record whom we want be added in any of the activity party fields. Mentioned below code shows the snippet that needs to be followed.

function setFrom() {
var partlistData = new Array();
partlistData[0] = new Object();
partlistData[0].id = “XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXX”;
partlistData[0].name = “Nameofuser”; //(Name value)
partlistData[0].entityType = “systemuser”;// (entity name)
partlistData[0].type = “8”; // (object type code 8 is for system user)
Xrm.Page.getAttribute(“from”).setValue(partlistData);
}

 

{Dynamics 365 / CRM 2016 Online Update 1}How to share Power BI embedded dashboard

Problem Statement –

How to share a Power BI embedded personal dashboard.

Using Power BI integration with Dynamics 365, we can create a Power BI embedded dashboard in Dynamics 365. However sharing that personal dashboard is not that simple. Dynamics 365 and power BI follow there independent authentication mechanism. Therefore it is essential that when we share that dashboard with users in Dynamics CRM, configuration settings must also be made on Power BI side. The article captures the configuration we need to make on Power BI side.

Background

 

Power BI integration with Dynamics was first introduced in CRM Online 2016 Update 1.

The mentioned below blogs explains how we can configure the integration between Power BI and Dynamics

https://technet.microsoft.com/library/dn708055.aspx

{CRM 2016 Update 1} Step by Step: Embed Power BI Tiles in Dynamics CRM Online

In a nutshell we need to follow the mentioned below steps

  1. Signup with Power BI on the url “https://powerbi.microsoft.com/en-us/”
  2.  After signing in Power BI, navigate to DataSets area ->Get Data->Services->Get and select the following content packs
  1. Microsoft Dynamics 365 (online) Sales Manager
  2. Microsoft Dynamics 365 (online) Service Manager
  3. Microsoft Dynamics Marketing
  1. For linking the Power BI with dynamics CRM, we need to authenticate the CRM organization by entering username and password.
  2. In Dynamics CRM, we need to login with a user having administrative security role.
  3. Navigate to Settings->Administration->System Settings
  4. On reporting tab, set Allow Power BI visualization embedding option to yes.
  5. Now navigate to Dashboards, create a new Power BI Dashboard.

 

Sharing the Dashboard

Now sharing the power BI dashboard works the same way in Dynamics CRM.

powerbiimage1

 

However if a user logs in to CRM this is what they will see

powerbiimage2

The issue is the dashboard must be shared in Power BI as well. Mentioned below screenshots show how this is to be done. Firstly login to Power BI, navigate to the dashboard and click on share. Mention the email id of the Dynamics 365 user with which you want to share the dashboard.

powerbiimage3

 

Now once the user logs in back to Dynamics, it should see the dashboard.

powerbiimage5

 

 

{Dynamics 365} Backup and Restore of CRM Online Organizations

Dynamics 365 has added a feature, wherein we can take backup of any organization, save it and then if need be restore the organization back to that state. Mentioned below screenshots show how the backup and restore works

  1. Firstly navigate to the Administrative Center of Dynamics 365. Click on link “Backup & Restore”

dynamics-365-administrative-center

2.  For creating a new backup, click of the button “New Backup”. We can select the organization for which we need the backup using the drop-down.

create-backup1

backup2

 

 

3. For restoring any organization, with the saved backup, we just need to select the organization and click on restore button.

{Dynamics 365} Preview Feature – Organization Insights Dashboard

A new reporting component to provide organization insights has been added in Dynamics 365. The enhancement was already added as a preview feature in CRM 2016 Update 1. These charts can be added to a dashboard and provide the mentioned below information

insights1

a) Active Users – Number of users that are logged at different times of the day.

b) Active Users Performing Specific Operations – Number of Different operations(Create, Update, Delete and Read) performed by active users at different times of the day.

c) Most Active User (Changes) – Number of changes (Create, Delete, Update) performed by different users past 2hours, 48`hours or past 30 days.

insights2

d) Total Page Requests – Page requests in classification of Dashboards, Reports and forms at specific times.

e) Total Operations – Total number of operations Create, Delete Update and Read happening at specific times.

f) Most Active Users – Read operations performed by the most active users.

For using organization insights, we need to be firstly configure them in the organization. The can be configured by navigating to Settings-> Administration-> System Settings -> Previews organizationinsightconfiguration

 

Repository Pattern Framework for Integration Scenarios with Dynamics CRM

Background

In my last engagement in Dynamics CRM, there were different possible integration points involving Dynamics CRM. The business logic had to access different data sources like sharepoint, PostGreSQL , SOAP API.

The integration points had to be developed through a Restful API. The API was consumed from both Dynamics CRM On Premise as well as some 3rd party applications. The article explains how the entire solution was designed and the repository pattern that was used for the same.

Repository Pattern

A repository pattern encapsulates the data layer from business logic by inserting an entity model in between. The business logic just acts on the entity model without considering into the complexities involving the data source behind the data layer. Based upon the integration point, the business logic just queries the entity model which in turn fetches data from the underlying data source. Any updates to the entity model as then transcended to the underlying database

Advantages of Repository Pattern

  • Consistent business logic can be applied to the database retrieved from different sources.
  • As consistent business logic is applied, code reuse will be more.
  • There are several objects from different sources like listitem in sharepoint, Dataadapter objects in SQL and NpgsqlDataAdapter class in PostGreSQL which are weakly typed. They can be mapped to strongly typed classes.
  • From the Rest API Client perspective, it only needs to call the exposed method on business logic. Underlying design will implement the logic concerning different data sources without exposing the complexities outside.

Design Architecture

restful-api

In coming blogs i will go deep down to explain the code structure followed in the repository pattern.