Search This Blog

Friday, December 23, 2011

CRM 2011 Ribbon: Using other controls than just Group and Button : ColorPicker!


As you might know, I developed some tools for ribbon usage (even if some of them are not really usable right now). Yesterday, I tried to use a ColorPicker control to check the behavior of my ribbon editor and found some inconstancy in the SDK.

Anyway, I wanted to try a ColorPicker control and try it in real life scenario (or something useful for your/my customers).

Here is the scenario: I want to be able to flag an account with a color (just like Outlook categories for email, appointment, etc.). For this, I will add a color picker on the ribbon and update the color of the form header (thanks to customer effective for this part: Changing the form header and footer colors).

The final look I expect:

CRM 2011 [En fonction] - Oracle VM VirtualBox_2011-12-22_22-39-31

What I need:

A solution with an image for my button, a script for changing header color, jQuery library to ease the write of scripts. The entity account is here since I apply the ColorPicker to this entity.

CRM 2011 [En fonction] - Oracle VM VirtualBox_2011-12-23_09-00-34

Script content:

function ApplyColorToHeader(commandProperties)
var filter = "";

if(commandProperties.Color != "#FFFFFF")
filter = "progid:DXImageTransform.Microsoft.Gradient(startColorstr=" + commandProperties.Color + ",endColorstr=#f6f8fa);";

$(".ms-crm-Form-HeaderContainer").css("filter", filter);


Alt="Color this form"
LabelText="Color this form"
ToolTipTitle="Color this form"
ToolTipDescription="Apply a color to this form header">
<Menu Id="McTools.Form.account.MainTab.Actions.ColorPicker.Menu">
Title="Choose a color">
<Controls Id="Ribbon.ListItem.Workflow.Controls.CPFlyout.Menu.MenuSection.Controls">
<Color Title="Red" DisplayColor="#FF0000" Color="#FF0000" />
<Color Title="Green" DisplayColor="#00FF00" Color="#00FF00" />
<Color Title="Blue" DisplayColor="#0000FF" Color="#0000FF" />
<Color Title="Cancel Color" DisplayColor="#FFFFFF" Color="#FFFFFF" />
<RibbonTemplates Id="Mscrm.Templates">
<CommandDefinition Id="McTools.Form.account.MainTab.Actions.ColorPicker.Command">
<EnableRules />
<DisplayRules />
<Actions />
<CommandDefinition Id="McTools.Form.account.MainTab.Actions.ColorPicker.CommandPicker">
<EnableRules />
<DisplayRules />
FunctionName="load" />
<CrmParameter Value="CommandProperties" />
<TabDisplayRules />
<DisplayRules />
<EnableRules />
<LocLabels />

Some explanations:

The ribbonDiffXml is made of a FlyoutAnchor that inclues the ColorPicker.

Then, we need two CommandDefinition items:

  • One for the FlyoutAnchor
  • One for the ColorPicker


The ColorPicker’s CommandDefinition calls the JavaScript function “ApplyColorToHeader” passing Crm parameter “CommandProperties”. This JavaScript object contains the property “Color” that contains the value of the attribute “Color” of the clicked Color item.




After having clicked on Green color

CRM 2011 [En fonction] - Oracle VM VirtualBox_2011-12-22_22-40-13


To switch back to the normal form color, I can click on the white color

Sans titre (100%) - Paint.NET v3.5


The original color is back!

CRM 2011 [En fonction] - Oracle VM VirtualBox_2011-12-22_22-42-18


Next steps:

To finish the scenario, it would be necessary to store the selected color in a hidden field. Then, in OnLoad event, the header should also be changed with the color selected.

Friday, December 2, 2011

The path to fame: New version of CRM 2011 SDK

Microsoft just released a new version of CRM 2011 SDK!

If you look deeply into it to gather information about the SiteMap, you could find my name somewhere Sourire


Look the page here

Monday, November 28, 2011

Tool update: CrmDiagTool2011 with access to remote CRM servers

Hi CRM community!

Last Friday and today, with my colleague Nicolas, we released a new version of CrmDiagTool 2011.

This version has not the capability to connect to remove CRM servers to manage Trace and DevErrors flag. This should save you time, removing the need to connect with a remote desktop to CRM servers…

This feature is not available for the Troubleshooting report.

If you missed the previous update, you can now save your trace profile to reuse it quickly.

Enjoy! (on codeplex, as usual)


Wednesday, November 9, 2011

New tool : Solution Import for Microsoft Dynamics CRM 2011


Today, I released a little tool to ease the import of solution in Microsoft Dynamics CRM 2011.

It displays a simple UI where you can :

  • change import settings
  • Drag & drop a solution file (Zip)
  • Define a path containing the extraction of a solution file


I hope this will help you a bit...

As usual, the tool is on CodePlex


Saturday, November 5, 2011

New version of CrmDiagTool 2011 and publication on CodePlex

Hi CRM community!

After having migrated the original CrmDiagTool 4 to Dynamics CRM 2011 and having recieved a lot of comments regarding new features, download location, etc. I felt that it was a good idea to make this tool public.

To avoid publishing "secret parts of code" from the original tool, I wrote new classes to have a fresh new project. This new project is opened to all CRM developers who would like to improve the CrmDiagTool.

So, the project is available on CodePlex

What else could I say? I hope many of you will have good ideas and time to spend on this project to make the ultimate diagnostic tool for our favorite CRM software!


Sunday, October 23, 2011

Tools update: CodePlex and PayPal links

Today, I have updated all my tools for CRM 2011 in order to add links to some CodePlex pages related to the tools. It will allow you to rate, comment and sumbit bugs more easly, simply by clicking on the corresponding buttons.

I also added a link to my PayPal account, if some of you want to support my work by making a donation.


You will also notice a new icon…

I really wish you will review my tools to make them more visible to the community, wether you like them or not.

Thanks to all of you for taking time for these reviews!

Thursday, October 20, 2011

Tool Update : Searchable Property Updater for CRM 2011 (1.1.919.75)

One of my fellow MVP asked me for the possibility to display if an attribute is displayed on at least one entity form. This will ease the decision to make an attribute valid for advanced find.

I thought it was difficult because of the need to export a solution to get the xml of an entity forms.

But it can be achieved a lot more easily! Entity forms, in Microsoft Dynamics CRM 2011, are just like any other entity, so you can simply retrieve the forms with a simple QueryExpression (or QueryByAttribute, in my case).

The code sample:

QueryByAttribute qba = new QueryByAttribute("systemform");
qba.Attributes.AddRange("objecttypecode", "type");
qba.Values.AddRange(entityLogicalName, 2);
qba.ColumnSet = new ColumnSet(true);

EntityCollection ec = oService.RetrieveMultiple(qba);

So, this new version is much more useful since you can see easily if an attribute is used on a form, and you can also check only attributes used in at least one form by pressing a single button.


As usual, you can download, review, discuss or log issue for this tool one codeplex

Wednesday, October 5, 2011

Updated tools for customized IFD deployments


Many of you reported errors when connection to there IFD deployments with customized Discovery Service Url (different from disco.servername.domain.extension).

I just updated all my tools to support these customized url.

Enjoy them!

NB: RibbonEditor has not been updated right now.

Monday, September 26, 2011

New tool: Role Updater for Microsoft Dynamics CRM 2011

Two weeks ago, one of my customer ask for some new entities in its CRM application. This was too easy… Well, my customer has also plenty of security roles and I had to update each of them regarding this new entity… boring!

So, you know what? I wrote a tool to update multiple roles in a single operation: The role updater.


How it works:

  1. Just click on “Load Roles and privileges” to display all master roles and list of all privileges.
  2. Check the roles that need to be updated
  3. Check the privileges to add or remove:
    • If privilege addition, select the access level associated with the checked privileges. Then click on button “Add Privilege(s)”
    • If privilege removal, just click on button “Remove Privilege(s)”

As usual, the tool is available on codeplex

Do not hesitate to comment, review and track issue on codeplex

Monday, September 5, 2011

Many charts leads to too many views : the (simple) solution

I do like all new visualization stuffs that come with Microsoft Dynamics CRM 2011! Of course, I’m talking about Charts and Dashboards. This is really a nice way to display key figures related to our customers data and objectives

Nevertheless, I faced more than one time a counter part of this easy way to display charts: I have now too many system views and the users can’t bear having to display twenty views where only two or three of them are not designed for charts.

Here comes another new feature: the ability to deactivate system views. The good point here is that even a deactivated view can be used in dashboards. It has still to be active when designing the chart or the dashboard but when it’s done, you can deactivate the view.

Thursday, July 14, 2011

New tool (alpha) : Ribbon Editor

Ribbons… such a beautiful new feature of Dynamics CRM 2011 but so hard to manage. We all know how to add a button to an existing group but doing more is complex due to all ribbon components, rules and actions available…

So, I’ll try to help you by releasing a new tool: the ribbon editor.

Ribbon Editor

This is not a wizard, you still need to know how a ribbon behaves but you shouldn’t need to learn all ribbon possibilities anymore…

I help you… I now need your help! There are so many possibilities that I can’t test and validate every ribbon possibilities. That’s the reason of the “alpha” release. So please try this tool and provide feedback on codeplex.

The more people try this tool the more bug will be identified and corrected!

The codeplex page where you can find the tool is located here :

CRM 2011: Overriding lookup onclick event

I know that some of you can’t wait to know how to override lookup control onclick event. Indeed, Microsoft has heavily used htc file for their controls behavior and it’s more difficult to change these behaviors than it was in Dynamics CRM 4.0…

So, here is the solution:

var element = document.getElementById("lookup_attribute_logicalname");
element.onshowdialog = function (event) {
var url = "http://you_custom_page_url" ;

var result = window.showModalDialog(url);
event.oLookupItems = { items: result };

The object returned from the page should be an array of Lookup items, like the following (example for an account):

var lookupItems = new Array();
lookupItems[0] = new Object();
lookupItems[0].id = "{...}"
lookupItems[0].name = "My account";
lookupItems[0].type = 1;
lookupItems[0].entityType = "account";

window.returnValue = lookupItems;

To be honest, I’m not the one who found this solution. All the credit goes to my colleague Nicolas.

Sunday, July 3, 2011

MVP: Year 2!

The news came Friday: I was renewed for the Microsoft MVP Award! One more year!

Thank you all for helping me to improve my tools and thus make life easier for developers and customizers on Microsoft Dynamics CRM.

Friday, July 1, 2011

Some remarks on my CRM 2011 tools


Some of you may have noticed that I update frequently the tools on codeplex projects… It’s just because I don’t have the possibility to test them against all type of deployments (regarding connections) or all usage possibilities (for example, all different combination of SiteMaps, all views configuration, etc.). I receive some issue by email from my fellow MVP’s and update the tools…

So, if one tool you used crashes or don’t work as expected, please start by visiting the codeplex project page to be sure you have the latest version. I try to maintain version number to ease this check.

If the last version still gets error, please feel free to create an issue on the codeplex project Issue Tracker page.

If you need extra features, create a new discussion thread.

Last but not least, if this tool is useful to you, rate it on the codeplex project page

PS: I have no more tools on my mind right now so don’t expect anything new if coming weeks…

PS2: I’m a liar… I have a tool in development since a long time, a ribbon editor but ribbons are so complicated that I really can’t release it as a beta/stable product… This tool is kind of a wizard to update ribbons but you will still need to know how a ribbon works… So, question: are you interested if I release this tool as an alpha product on codeplex, meaning this can crashes from everywhere?

Tuesday, June 28, 2011

New tool: SiteMap Editor for Microsoft Dynamics CRM 2011

With the last version of Microsoft Dynamics CRM, you can organize your customizations through solutions and this is really a nice feature. But some specific actions are taking really more time than with previous versions…

This is exactly the problem when you want to edit the SiteMap. You have to add the SiteMap to a solution (maybe create one before), export the solution, extract the solution, update the Xml, zip the files, import the solution (should I need to continue with import wizard steps…? Sourire)

So, today, I release my new tool, the SiteMap Editor. It works like the IsvConfigManager for Microsoft Dynamics CRM 4.0 to edit the SiteMap.


  • Connections to OnPremise, Online and Claim based deployments
  • TreeView display of SiteMap
  • Add SiteMap component with mouse usage
  • Add default SiteMap component if you removed one
  • Cut/Copy/Paste of SiteMap component
  • Display Xml of SiteMap component
  • Add SiteMap component from Xml
  • Reset SiteMap to default system one
  • Import back the SiteMap to CRM server




As usual the application is available on codeplex.

Wednesday, June 22, 2011

New tool: JavaScript Web Resource Manager for Microsoft Dynamics CRM 2011

I didn’t find a way to provide you a JavaScript editor as flexible as the one I created for Microsoft Dynamics CRM 4.0 since the scripts are now in two parts in Microsoft Dynamics CRM 2011: web resource and script call from forms…

Anyway, this new tool allows you to update JavaScript web resources with the following features:

  • Export scripts web resources from CRM server
  • Save scripts web resources to disk
  • Load scripts files from disk
  • Edit scripts with default text editor or Visual Studio
  • Edit web resource properties
  • Save scripts to CRM server
  • Publish scripts to CRM server

It should help you avoid multiple clicks as soon as you want to update a JavaScript web resource…

As usual with my tools for CRM 2011, it is published on codeplex

Just a small reminder : a Paypal donation button is just on the right part of this blog Sourire 

But it’s up to you…



Wednesday, June 15, 2011

New tool: Ribbon Browser


I've not been really active these last weeks but I was on holiday (I love New York !) and I’m busy to buy a new appartment, so that’s not easy…

Anyway, today is a new day and I’m releasing a new tool: Ribbon Browser.

This is basically the same program that is provided in the SDK as a sample (exportribbon) but with a graphical user interface.

It will be helpful to retrieve Id’s and other attributes of ribbon controls when you want to update the system ribbon.

You will be able to:

  • Display system entity ribbon definition
  • Display custom entity ribbon definition
  • Display Ribbon control attributes
  • Display Ribbon control XML
  • Save ribbon in XML file

The tool is released on codeplex


Ribbon Browser

Friday, April 29, 2011

How to: Which action raised OnSave event

A while ago, I wrote a post about the way to know which action raised the onSave event in Microsoft Dynamics CRM 4.0, here.

Here is the same code for Microsoft Dynamics CRM 2011:

// The execution context must be passed as the first parameter
// This can be done by ticking the checkbox in the function call
// window in the onSave event
function CheckSaveEvent(executionObj)
// If action is Save as closed (=58)
if(executionObj.getEventArgs().getSaveMode() == 58)
// Do some code logic

The check that must be ticked is the one in the below screenshot (This is the window that is displayed when adding script on the onSave event).

CRM 2011 RC1 [En fonction] - Oracle VM VirtualBox_2011-04-29_15-56-30

Wednesday, April 20, 2011

New tool: CrmDiagTool 2011

UPDATE: A new version is available on CodePlex

Hello CRM community!
Two months ago, Philippe Brissaud from Microsoft Canada asked me to help him migrate the well known CrmDiagTool 4 to Microsoft Dynamics CRM 2011. I guess you know what I answered him: of course I help!
Today, Philippe and I are proud to release this new version of CrmDiagTool.
We focused on Server diagnostics and removed features related to reporting services and email router.
The features are the following:
  • Enable/Disable tracing
  • Zip content of Trace directory
  • Open Trace directory
  • Generate diagnostic file in text or html format with components selection
  • Enable/Disable DevErrors
Some screenshots:
Regarding source code: As the previous version had not its source code released, this version does not too.
Download link:

Tuesday, April 19, 2011

How to: Change existing ribbon element properties

Today, I will try to explain you how to change properties of existing ribbon elements. For this example, I will change the label and icon of the button “New opportunity” in the main grid ribbon of the entity “Opportunity”.

The standard ribbon for the opportunity looks like the below one:


And the result I expect:


To obtain this result, follow the below procedure:

1 - If it is not already done, download the SDK (click here).

2 - Open the SDK folder “samplecode \ cs \ client \ ribbon \ exportribbonxml \ exportedribbonxml”. Then open the Xml file corresponding to the entity (here opportunity.xml). In our case, the button “Nouveau” (or “New” in english), is the one we need to retrieve:

<Button Id="Mscrm.HomepageGrid.opportunity.NewRecord" ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.New" ToolTipDescription="$Resources(EntityDisplayName):Ribbon.Tooltip.New" Command="Mscrm.NewRecordFromGrid" Sequence="10" LabelText="$Resources:Ribbon.HomepageGrid.MainTab.New" Alt="$Resources:Ribbon.HomepageGrid.MainTab.New" Image16by16="/_imgs/ribbon/NewRecord_16.png" Image32by32="/_imgs/ribbon/newrecord32.png" TemplateAlias="o1" />

3 - Create a new solution with the opportunity entity included and export it.

4 - Add a CustomAction with the correct location in the CustomActions node of the customizations.xml file contained in the exported solution archive. Only two attributes are required:

  • An identifier of your choice
  • A location (the location of the existing button): You will find the correct location in the parent node of the existing Xml button (in the opportunity.xml file). It is the attribute “Id” of the parent node. The location will be the concatenation of this id and the term “._children”.

5 – Add the Xml of the existing button

6 – Change the properties of the button (here, highlighted in yellow)

<CustomAction Id="MSCRMTools.HomepageGrid.opportunity.MainTab.Management.Controls"
<Button Alt="$Resources:Ribbon.HomepageGrid.MainTab.New"
ToolTipTitle="$Resources:Ribbon.HomepageGrid.MainTab.New" />
<RibbonTemplates Id="Mscrm.Templates" />
<CommandDefinitions />
<TabDisplayRules />
<DisplayRules />
<EnableRules />
<LocLabels />

7 – Import back the solution, that’s it!

Sunday, April 10, 2011

My CRM 2011 tools are now Claim based authentication compatible

Everything is on the title Sourire

Please take time to rate my tools on codeplex if you like them and if you really like them, you can even make a donation (see Paypal button on your right)

Many thanks to Alex Fagundes and PowerObjects for providing me a Claim Based authentication organization on their servers. It helps me a lot for testing my tools.

I owe you one, Alex !

Wednesday, March 9, 2011

30.000 visits! Thank you!

I did not expect as many visits to my blog… This means 10.000 new visits in a little more than 5 months.

Thank you to all those of you who read my blog regularly!

2011 seems to be a very good year for Dynamics CRM with a lot of new features coming (thanks to solution framework included in Dynamics CRM 2011), new tools (special thought for Rhett Clinton Sourire) and new experiences.

Already two tools upgraded to CRM 2011, and a few secret projects underway… Stay tuned!

Thursday, February 24, 2011

Enable trace in Microsoft Dynamics CRM 2011

You know that indispensable tool for Dynamics CRM 4.0 that allows us to enable tracing: CrmDiagTool 4.0

I was wondering if a tool will be available for CRM 2011… Just for fun, I tried to activate the trace using CrmDiagTool 4.0 and… it worked!

At least, for the server trace. I didn’t test the other trace options.

Example of trace files in CRM 2011:


Tuesday, February 22, 2011

CRM 2011 and Security Exception enhancement

Do you remember the difficulty it was to identify a missing privilege when reading security exception logs in Microsoft Dynamics CRM 4.0? We had to query the database which was quite annoying… The messages were the same kind as one of the below messages:

  • When you try to perform an action that is affected by another user security limitation

SecLib::AccessCheckEx failed. Returned hr = -2147187962, ObjectID: 1ef9f412-6601-dd11-8655-0019b9dfe618, OwningUser: 98bbc999-96a2-de11-aeaf-0019b9dfe227 and CallingUser: 037c1c90-96a2-de11-aeaf-0019b9dfe227

  • When you try to perform an action when you don’t have the privilege to actually do it

CrmSecurityException: SecLib::CrmCheckPrivilege failed. Returned hr = -2147220960 on UserId: 60826d61-2be1-db11-821c-000423b79351 and PrivilegeId: 588725dd-c878-41c5-a4c3-5efc93cd3ffd

Microsoft Dynamics CRM 2011 improve drastically the error message to avoid a fastidious search in database:

  • When you try to perform an action that is affected by another user security limitation

SecLib::CrmCheckPrivilege failed. Returned hr = -2147220943 on UserId: 9d67828d-a13e-e011-af72-0800273a66a6 and PrivilegeType: Read

We can see that the only userId displayed is the one who actually causes the exception and the privilege is named instead of being displayed through its unique identifier.

  • When you try to perform an action when you don’t have the privilege to actually do it

Principal user (Id=9d67828d-a13e-e011-af72-0800273a66a6, type=8) is missing prvDeleteAccount privilege (Id=ca6c7690-c935-46b3-bfd2-abb306c2acc0)

Again, the privilege is named


It seems that headaches caused by security exceptions are behind us with this new version of Dynamics CRM. Another good point!

New tool: Searchable Property Updater for Microsoft Dynamics CRM 2011

Today, I finished the upgrade of Searchable Property Updater for Microsoft Dynamics CRM 2011.

Searchable Property Updater1

I posted the tool, the source code and the documentation on codeplex. Use the link below to access to these files: 

As english is not my native language, if someone would like to help me improving the documentation, I will be happy to receive some help.

Sunday, February 20, 2011

New tool: View Layout Replicator for Microsoft Dynamics CRM 2011

Today, I finished the upgrade of View Layout Replicator for Microsoft Dynamics CRM 2011.

View Layout Replicator

I posted the tool, the source code and the documentation on codeplex. Use the link below to access to these files:

As english is not my native language, if someone would like to help me improving the documentation, I will be happy to receive some help.

Friday, February 4, 2011

Tool Update: View Layout Replicator

Hi guys,

I updated this utility to support related entity attributes.

Indeed, some rollup (don’t know which one) changed the way the related entity attributes are configured in the layoutXml of a savedquery.

This change caused the utility to crash unexpectedly if you selected a view containing related entity attributes.

This is now corrected!

Use habitual download location

Wednesday, February 2, 2011

Screenshot tool: Greenshot

Breaking the habit, this post is not related to Dynamics CRM. I just wanted to share with you a little tool I use to get screenshot: Greenshot

Greenshot is a light-weight screenshot software tool for Windows with the following key features:  
  • Create complete or partial screenshots quickly.  
  • Easily annotate, highlight or obfuscate parts of the screenshot.
  • Send the screenshot to a file, the clipboard, a printer or as e-mail attachment.

Being easy to understand and configurable, Greenshot is an efficient tool for project managers, software developers, technical writers, testers and anyone else creating screenshots.




Thursday, January 6, 2011

CRM 2011 Plugins: Welcome to transactions !

One of the thing I hate about CRM 4.0 plugins is the inability to automatically rollback actions when an exception occurs during a business process.

To illustrate this, imagine a plugin which creates a contract, then a line of contract. If the code throws an exception during the creation of the contract line, you need to take care yourself of deleting the contract that have been created: of course, you need the contract AND the contract line, not just the contract.

In CRM 2011, you can now register your plugin in new stage (see below). That means that you can register your plugin in a transaction (if using stage 20 and 40) and whenever you plugin throws an exception, every action done during the transaction will be rollback. In our previous example, that means tha the contract will be deleted automatically by the application.

Event Stage Name Stage Number Description
Pre-Event Pre-validation 10 Stage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage may execute outside the database transaction.
Pre-Event Pre-operation 20 Stage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage are executed within the database transaction.
Post-Event Post-operation 40 Stage in the pipeline for plug-ins which are to execute after the main operation. Plug-ins registered in this stage are executed within the database transaction.
Post-Event Post-operation 50 Stage in the pipeline for plug-ins which are to execute after the main operation. Plug-ins registered in this stage may execute outside the database transaction. This stage only supports Microsoft Dynamics CRM 4.0 based plug-ins.
More informations on the SDK page :