Using Quick View form in CRM 2013 to show filtered set of related records.

Recently we had a requirement in our project where on the opportunity form, when the sales manager selects the account, the system should show the list of activities related to the account. The requirement looked very interesting and the first thing that came to our mind is to utilize the Quick View form to achieve the same. The following are the list of steps of what we did.

1. Created a quick view form for the account entity with Account Name and activities sub-grid for the account entity. Check for the screenshot below.


2. Inserted the Quick view form of the account in the form of the opportunity entity.

3. The result is when the Sales Manager selects an account while creating the  opportunity, he is able to see the list of the related activities for the account. Check for the screenshot below.



The user was able to even add new email messages through the sub-grid. Using this Quick View feature, we could resolve this requirement with very little configuration.


Hope this helps!

The type Microsoft.Crm.Web.Reporting.CrmReportServerConnection, Microsoft.Crm.Application.Pages, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35 does not implement IReportServerConnection or could not be found

We encountered this error recently when we upgraded from CRM 2013 to CRM 2015. We had our plugin where we used to execute a custom SSRS report and get the byte content of the report and create an attachment for an entity. For this we had a reference to the Microsoft.ReportView.WebForms dll v 10.0

The code used to work perfectly in CRM 2013. However when we upgraded to CRM 2015, we started getting the above error. The reason for this is because CRM 2013 utilizes Microsoft.Crm.Application.Pages.dll v6.0 which is compatible with Microsoft.ReportViewer.WebForms. dll v10.0. However CRM 2015 used the Microsoft.Crm.Application.Pages.dll v7.0 which goes with Microsoft.ReportViewer.WebForms. dll v11.0.

Updating our project to refer to Microsoft.ReportViewer.WebForms. dll v11.0 resolved this issue.


Hope this helps!

Open Advanced Find from Anywhere in Dynamics CRM 2013

Our customer recently upgraded from CRM 2011 to CRM 2013 and one of the very first concerns that the customer faced is they were missing advanced find from the record view. Every time they wanted to open advanced find, they had to go back to the Grid View of the records and open advanced find.

A little bit of searching and came across the below wonderful post. Can stop myself from sharing this.

I am sure you would definitely be benefitted by this tool.


Hope this helps!

{Dynamics CRM Plugins Impersonation} Identify which for your plugins are running under impersonation

Recently we upgraded one customer from their CRM 2011 to CRM 2013 environment. During the process of upgrade and new features implementation, we were developing in separate environment while the existing customer system was still going on.

Just before going live with the upgrade, our client informed us that there had been considerable number of changes in plugin configuration specially in relation to the user’s context under which the plugin was running and their internal team lost the track of all those changes. To tackle this first we did a thorough merging of the plugin code and then deployed the solution in CRM 2013 Production environment. Then we ran the below SQL in the existing production environment and the new production environment.

Select DISTINCT pa.Name [Assembly],
pt.Name [Event Handler],
mpt.Name [Step],
CASE mpt.Stage
END AS Stage,
sm.Name [Message],
ev.LogicalName [Entity],
su.FullName [Impersonating User]
FROM SDKMessageProcessingStep mpt INNER JOIN SDKMessage sm ON mpt.SdkMessageID = sm.SDKMessageId
INNER JOIN SDKMessageFilter mf ON mf.SDKMessageFilterId = mpt.SDKMessageFilterId
INNER JOIN EntityView ev ON ev.ObjectTypeCode = mf.PrimaryObjectTypeCode
INNER JOIN PluginTypeBase pt ON mpt.PluginTypeId = pt.PluginTypeId
INNER JOIN PluginAssemblyBase pa ON pt.PluginAssemblyId = pa.PluginAssemblyId
INNER JOIN Systemuser su ON su.SystemUserId = mpt.ImpersonatingUserId
WHERE mpt.ImpersonatingUserId is NOT NULL
AND mpt.Stage <> 30 AND mpt.IsCustomizable = 1

After running the above code, it became very easy for us to go to the appropriate steps and change it by comparing the results from both the environments.

Hope this helps!

Understanding how SLA’s work in CRM 2013. Effects of change in SLA details or deactivation of SLA on a case.

In think by this time, many of you must already have used the SLA feature that came with CRM 2013 SP1. Hence i am not going to explain here what that feature is and how can we use it for our implementations. Rather I would like to share my answers to the common questions that i regularly face from participants during training sessions on CRM 2013 SP1 SLA feature. Some of the common questions are

  • What happens if the applicable SLA details changes for a case?
  • What happens if an SLA is already applied to the case and if somebody has deactivated the SLA to modify the SLA details?
  • What happens if an SLA is already applied to the case and if somebody has changed the SLA details in the middle for e.g for warning actions somebody has configured to send an email and the email subject and description is modified. Will the new SLA details be applied to the existing cases?


The first point we should always understand if CRM implements the SLA feature using background workflows. So if you know how workflow state persistence mechanism works you already have answers to all the above questions. Not getting what I am trying to explain. No issues. Let us take each of the questions one by one.

For this demo, I have created a default SLA with two SLA details – one for high priority cases and the other for fallback.

  • For the high priority SLA detail, it expires if the First Response is not sent within 5 mins of the case creating and an warning goes at the end of one minute. In both the cases it sends out an email messaging accordingly
  • For the fallback SLA detail, it expires if the First Response is not sent within 1 hour of creating the case and an warning goes at the end of 30 mins from case creation.


Check the screenshot below.




Scenario 1: Applicable SLA for a case changes when the case is updated.

I create a case with priority = ‘Norma’l’. The default SLA is applied and the First Response by is set to 1 hour from the creation of the case. Check the screenshot below


Now I go ahead and change the Priority to high. As soon as i do that the applicable detail for the case changes and as you can see in the screenshot below the First response by is set to 5 mins from the creation time of the case.


So what happened in the background? When the case was first created, a workflow triggered for the default SLA detail configuration. However when the priority of the case was changed to High, the previous workflow instance was cancelled and a new workflow instance with the configurations of the SLA details for high priority cases was initiated. You can check by going to the background processes of the case.



Scenario 2: SLA details for a SLA is updated while the SLA is already applied to a case or the SLA is deactivated after being applied to a case.

To demo this, what i have done is i created a case with high priority. The SLA for  high priority cases got applied to the case.


In the meantime i went ahead and deactivated the SLA and also changed the email subject and description that is sent when the SLA expires.



However when the email is sent after 5 mins of the case creation, the body and the subject is not reflecting the changes. It would still show the previous body and the subject. Similarly even if you deactivate the SLA after is has been applied to a case, the existing instances of the workflows for that SLA will continue as usual and will not cancel out.



Hope this helps!

Dynamics CRM 2013 – Client API’s to interact with Business Process Flows

While implementing Business Process flows for our customers, how I wished for if Microsoft had provided Client API’s to deal with the Business Process Stages. How easily I could have implemented some of the requirements that customers asked me regarding Business Process flows. I am sure that many of you have wished if we could control the next and previous stage movements but sadly even with 2013 SP1 release, there is no client API provided. Although Microsoft is coming up with very efficient client API to deal with business process flows, but my customers has recently upgraded to 2013 and they don’t want to shift to 2015 now.

So I decided to put all the workarounds I made during my customer implementations and put that in a jScript library so that others can just refer & use it during their development. I have published the library in codeplex. The tool is available for download at the following codeplex URL:

Till you upgrade to 2015 version, you can use it for your purpose. It does whole lot of stuffs which include

  • Register you own custom event handlers when Next Stage and Previous stage is clicked in the business process flow.
  • Collection of all the stages in the business process flow with their following properties
    • Name of the stage
    • Is it currently the active stage
    • Is it currently the selected stage
    • The index (sequence number) of the stage
  • The stage which is currently active in the business process flow
  • The stage which is currently selected in the business process flow
  • Active stage id
  • Active process id

And whole lot of other functionalities!

Please note: This tool utilizes jQuery to achieve its functionalities. However their is no major manipulation of DOM elements done by this tool as such. So you can try it out safely for your organizations. I have tested this tool with CRM 2013 SP1 version and it works fine.



Hope this helps!

CRM 2013 SP1 Duplicate Detection Bug – Really a bug or expected framework behavior?

As many of us know, with CRM 2013 SP1, duplicate detection is back. Personally I liked it a lot because you can avoid potential duplicates just through configuration without writing plugins and also you get an option to continue with the duplicate record or to perform actions like merge on the duplicate records,

So came the requirement – “There should not be two records with the same field value in the same business unit” . So simple isn’t it. Happily i went ahead and suggested to apply OOB duplicate detection rules for this requirement. But my happiness was short lived. Lets us see why.

I have created a custom entity called ‘DupDetect’ for this demo. There is field called ‘Dup Field’ in this entity. To put the above requirement for this demo, there should not be two records with the same value of ‘Dup Field’ in the same business unit. So i went ahead and created the following duplicate detection rule and published it.


Now i move to entity and as you can see in the screenshot below, there is one record of DupDetect Entity with Dup Field value of ‘Dup 1’ owned by me.


Now i create one more record with the same ‘Dup 1’ in Dup Field and strangely the system does not show up any duplicates warning. As you can see below, there are two records with the same value for Dup Field and with me as the owner.


Well fine. duplicate detection did not work during create. I then thought of checking for update. I tried to change both the values for Dup Field to “Dup 2”. And voila now it shows a duplicate.


So I am not sure whether this is bug or not. My understanding is that during create when the duplicate detection is fired from the framework, the owningbusinessunit of the userid is still not deduced because owningbusinessunit of the record is deduced from the owner of the record. Hence did not show the duplicate detection pop-up. This is just my assumption and I would have to like your ideas on this.


Thanks for reading!