Thursday, December 20, 2012

MS CRM 2011: How to cancel/postpone Workfow Instance using C#

Today I had a task to cancel about 25k instances of the same workflow. Of course it was possible to create Advanced Find View and go through 100 pages cancelling all workflows on the page. But I’m too lazy and I know C# to do that manually.

Tuesday, November 13, 2012

Integrating CRM 2011 using SQL Integration Services 2012

I have already wrote similar article using SSIS 2008. Following article describes how to use the same functionality using new version of SSIS.

Friday, November 09, 2012

MS CRM 2011: T-SQL Union operation and FetchXml based reports

I believe every person who developed complex reports for CRM used T-SQL Union operation to display different types of records at the same table.

In T-SQL I used following T-SQL Query to get results:
    AccountId RecordId
    ,Name RecordName
    ,'account' RecordTypeName
From FilteredAccount
    ContactId RecordId
    ,FullName RecordName
    ,'contact' RecordTypeName
From FilteredContact

And results were:

When CRM 2011 was released we got possibility to create reports for CRM Online but it is limited to usage of FetchXml reports that doesn’t have Union operation. Following article describes workaround.

Monday, November 05, 2012

MS CRM 2011: General approaches to generation of reports

Following article describes general steps to use web services of Reporting Services.

MS CRM 2011: ‘Publish report for external use’ functionality brakes subreports

Today I faced with this issue. I published standard ‘Quote’ report for external use tried it and it didn’t worked. I got following message once I tried to run a report:

Thursday, November 01, 2012

MS CRM 2011: How to refresh Associated or SubGrid from Ribbon button

Today I have got requirement – create custom ribbon button placed to Associated View of entity, execute some logic and invoke refresh of grid. Last point was the trickiest one and that’s why I decided to share with approach how to do it.

Friday, October 05, 2012

Tool that increases limit of record during export to Excel for Dynamics CRM 2011

One of my customers wanted to increase this limit. I made small investigation and discovered that setting that controls limit of records is stored at Organization entity in MaxRecordsforExportToExcel column. The easiest way to change this setting for On Premise of course was to Update directly OrganizationBase table but customer’s CRM is OnLine. So I developed small tool that allows to connect and update this setting using CRM Sdk.

Friday, September 07, 2012

MS CRM 2011: How to check user rights on client side

Today I have got requirement to write function which will validate rights of user. In our specific case we had to show/hide buttons on custom web form. I decided to post results of my work here.

Tuesday, August 07, 2012

MS CRM 2011: Sharing Summary Report

Sharing is amazing feature which is provided with Dynamics CRM. Unfortunately it is not easy to say which record is shared with whom and which privileges are provided. I have created report using which you can get this information.

Saturday, July 14, 2012

MS CRM 2011: Strange issue with filtered lookup

Today I was working with filtered lookup. Before I had no issues with it but today I faced with strange issue.

Friday, July 13, 2012

MS CRM 2011: N to N Import/Export WebResource

I'm glad to announce that I have finished my Import/Export N to N relationships tool for CRM 2011.

Tuesday, June 12, 2012

Why my navigation control isn't clickable?

Just imagine... You are developing report for CRM which should allow you to open records of CRM from report. You have done everything in accordance to SDK - but... navigation item doesn't work.

Saturday, June 02, 2012

MS CRM 2011: N-N Relationship control: checklistbox style

I have developed WebResource for CRM which displays N-N relation in checklistbox style and decided to share it:

Friday, June 01, 2012

MS CRM 2011: CallerOrigin in plugins

Yesterday well-known MVP Tanguy Touzard, author of amazing tools for Dynamics CRM 4.0/2011 asked about CallerOrigin property in plugins for Dynamics CRM 2011. This property worked for CRM 4.0 and returned the source of plugin invocation (Application, AsyncService or WebService). I and Gayan suggested to use HttpContext class from System.Web namespace to check source.
 Today during debug of one plugin in QuickWatch window I have seen that CallerOrigin property is still in context but it is not property of IPluginExecutionContext:

MS CRM 2011: Sql Timeouts during access to views

Yesterday we have deployed solution on productive system and imported data – about 40 millions of records in different entities. During testing “Generic Sql Exception” messages begun appear for some types of records.

Wednesday, May 30, 2012

MS CRM 2011: Strange error during sending of an email from plugin

I had scenario when my plugin based on some condition had to send an email. I developed plugin, deployed it to server and during the testing I have got quite strange error:

Friday, May 25, 2012

MS CRM 2011: Embed context report to left navigation pane

Idea of this blog post is how to embed report to left navigation pane of Crm editing form. I have found this brilliant post which describes how to embed report into IFrame located on Crm editing form and I took this post as basis for current post.

Monday, May 21, 2012

MS CRM 2011: Import of marketing list members using standard import with small extensions

Unfortunately at the moment it is impossible to import Marketing Lists Members to CRM with out-of-box import. My friend, former MVP and employee of Microsoft Artem Grunin provided good approach how to eliminate this problem with small customizations and plugin.

Sunday, May 20, 2012

MS CRM 2011: Data transferring between systems

I think a lot of developers faces with integration between systems. It could be connection between CRM and accounting systems. To track changes that appeared at CRM and should be transmitted to other system I use plugins but how to understand what was the source of this changes – user of CRM system or synchronization service – this is the question. I use following approach to solve this issue:

Friday, May 18, 2012

MS CRM 2011: Code which rechecks that N:N relation exists between 2 records

Sometimes in your code you have to recheck is relation between 2 records exist. I faced with the same issue and developed following code.

Saturday, April 21, 2012

MS CRM 2011: Adding users to Team: Handling with plugins

Several times I have read that other developers were not able to handle event of adding users to teams with their plugins. I didn’t have any time for experiments till time I have got task to develop similar plugin.

Saturday, March 03, 2012

MS CRM 2011: Extended handling of Save events in Microsoft Dynamics CRM 2011

About 1.5 ago I wrote post which describes how to work with additional parameters during save of form. I decided to go through all available standard forms and create extended list of available parameters.

Thursday, February 23, 2012

MS CRM 2011: Bulk refresh of user details from AD

When you create user in CRM all the available information is populated from AD into CRM user form. But in case information was changed in AD (email box, phone e.t.c.) - information will remain unchanged till the moment you will open form of user and change it. In case a lot of information was changed it will be quite boring to update users information one-by-one.

Following post describes how to allow bulk update of user details.

Saturday, February 11, 2012

Integrating CRM 2011 using SQL Integration Services (SSIS)

I read this article and decided to make something similar for CRM 2011. You can see results in this post.

Wednesday, February 08, 2012

CRM 2011: Playing with notes control

If you want for some reason to allow/disallow user to insert or edit notes in Microsoft Dynamics CRM 2011 following code can help you:

function FormatNotesControl(AllowInsert, AllowEdit)
var notescontrol = document.getElementById('notescontrol');
if (notescontrol == null)
var url = notescontrol.src;

if (!AllowInsert)
url = url.replace("EnableInsert=true", "EnableInsert=false");
if (!AllowEdit)
url = url.replace("EnableInlineEdit=true", "EnableInlineEdit=false");

notescontrol.src = url;

function DisableNotesInsert()
FormatNotesControl(false, true);

Copy script, insert it to webresource, add this webresource to required form and call it during onload/onchange of form. And you should not forget that this script is unsupported because it uses document object and it's methods.

CRM 2011: Creating a Network Path Text Control for Microsoft Dynamics CRM 2011

Following approach is a little bit unsupported so be careful using it.

Create JavaScript webresource, put in it following code, call OnLoad method during loading of form of your entity:

function OnLoad()

function Transform(fieldid)
var c = document.getElementById(fieldid);
if (c == null)
return; = "underline"; = "blue"; = "hand";
c.ondblclick = function()

Field has to be simple text type. Replace new_name with field you want to transform. Result for my case:

Friday, January 06, 2012

MVP Renewed - 2

Third year in a row I have got MVP award.
This year was the most complicated in my life and I'm glad to get this award one more time.