Can’t stop myself from sharing through my blog – Tool to generate early bound classes using CrmSvcUtil.exe.

Recently I had a requirement to filter out some of the entities and optionsets while generating early bound classes using CrmSvcUtil.exe. I was almost done writing my custom code for that when my colleague pointed me towards this wonderful tool in codeplex. The link for this tool is available for download from the following codeplex URL –

I am pretty sure that after after using this tool, you would never want to use CRMSvcUtil.exe again

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!

{Dynamics CRM 2015 Error} – Changing security attributes is not allowed in stage 20 plugins

Recently we upgraded from CRM 2013 SP1 to CRM 2015 version for our customer. We have upgraded to CRM 2015 on the first access (FA) version of 2015 that our customer had from Microsoft.

However after upgrading to CRM 2015 and doing a quick sanity check on the environment, we started getting the following error during creating of certain entities.

“Changing security attributes is not allowed in stage 20 plugins”.

The reason for this error is because in the pre-create of the plugins, we were changing the owner of the records to some teams based on some business logic. Hence we were setting the ownerid field in the pre-create plugin. the code was working fine with 2013 SP1. However it failed in CRM 2015.

Moving this code to post-create and executing the assign request resolved this issue. We have faced this issue with the First Access version. However moving this might be fixed in the RTM version of CRM 2015.

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!