Category Archives: XML, Ribbon and SiteMap

All the code regarding the Ribbon , the SiteMap and others XML functions.

Ribbon tutorials

Gareth Blog

Standar Button Behaviour Modification(the best one for existing ribbon modifications)

Disable Activate/Deactivate Buttons base on Delete priviledge.

Other Usefull Blog

Loading libraries before needed for the javascript execution

<JavaScriptFunction FunctionName=”isNaN” Library=”$webresource:epa_json2.js” />
<JavaScriptFunction FunctionName=”isNaN” Library=”$webresource:lema_SDKRest.js” />
<JavaScriptFunction Library=”$webresource:YOUR FUNCTIONSLIBREARY” FunctionName=”YOURFUNTIONNAME”>

<EnableRule Id=”Mscrm.Lema.RuleDisableDependLicenceEstate”>
<CustomRule FunctionName=”isNaN” Library=”$webresource:epa_json2.js” />
<CustomRule FunctionName=”isNaN” Library=”$webresource:lema_SDKRest.js” />
<CustomRule FunctionName=”entityEstateOpen” Library=”$webresource:epa_Submissions” Default=”true”>
<CrmParameter Value=”PrimaryControl” />


CRM2011 training . SDK, Office 365 login and CRM Online.

To train some developers at our office we used the SDK 5.0.12 with CRM2011 Online and Office 365 login approach.

When we downloaded the SDK we found several problems while using the SDK tools mainly with the ExportRibbon utility and the Plugin Registration tool.

All the problems were related to connexion and once we found a way to connect those tools to the CRM everything worked smooth.

I will describe the solutions we found to fix those problems.

Problem 1: Plugin Registration Tool –> The service is unavailable.

We found 3 problems with the PluginRT ,

First of all we hadn´t installed the Windows Identity Foundation tools and we couldn´t build the C# project due to IDentityModel issues.
If you have the same problem please download the right version of Windows Identity Foundation for your system from here .

Second, we had connection problems with the message “service unavailable” or “proxy requires auth”. To fix this issue we just added an app.config file to the Plugin RT with the following code were we specify our proxy settings.

    <defaultProxy enabled="true" useDefaultCredentials="true">
      <proxy bypassonlocal="True" proxyaddress="http://100.100.300.200:8080" />

Finally we had some problems at one of the machines due to time mismatch between CRM2011 server and the developer machine.
You can change the server time zone in the File/Options menu of CRM and make sure is the same that your clock time zone.
After that using the prompt command “w32tm /resync” you will have your computer synchronized with the internet global time zone setting.

Problem 2: Exported Ribbon XML –> Username and Password must be provided.

When executing the exportRibbonXML project we had some connexion problems with the following message: “username and password must be provided.”.

These message was shown before the tool asked for a username or password. Debugging the tool we manage to jump the step where the connexion was made and
pass to the step where the name and password where input. After that, the connexion was made and the tool created a XML file with the credentials.

If you try to connect again , the tool will check for this file and follow to correct sequence to connect without problems.

If you are experiencing the same problems I suggest you copy this XML, write your organization and username values and save it as Credentials.xml in the

C:\Users\<yourLoginUser>\AppData\Roaming\CrmServer folder.

<?xml version="1.0" encoding="utf-8"?>

Modifying the SITE MAP based on privileges

In CRM2011 is possible to Edit the Left menu (called SiteMap) based on the privileges of the different users.

To archive this goal you need to follow the following simple steps.

1.- Create a new solution called “MySiteMap”.
2.- Edit the solution and Add an existing component called SiteMap.

Adding the SiteMap to the solution
3.- Export the solution
4.- Extract the files of the MySitemap***.zip solution file.
5.- Edit the customization.xml file with a text file editor such as Notepad++.
6.- Find the area called SiteMap and edit it to show/hide menu options based on privileges of a user over an entity. (For example Create privilege over contact entity).

7.- Save the file, zip the solution, import it into CRM2011 and publish the solution.

 Description of the <SiteMap> Area — customization.xml:

Inside the <SiteMap> tag you will see a definition of the 5 areas that conform the SiteMap. Each area will be divided in subareas. To organize the diferent subareas you can use groups.

Areas:SiteMap Area, subarea and groups.

  • Area_Workplace
  • Area_Sales
  • Area_Marketing
  • Area_Service
  • Area_Settings
  • Area_ResourceCenter

In the image you can see the area WorkSpace with the subareas Accounts,Contacs,Marketing Lists,Leads and Opportunities.

To organize the subareas we used the Customers and Sales Groups.


A group with all his subareas hidden will not be shown.

An area with all the subareas hidden will not be shown either.

We can show / hide every subarea specifying a privilege control in each subarea the following way.

<SubArea Id=”nav_reports” Entity=”report” DescriptionResourceId=”Reports_Description”>
<Privilege Entity=”report” Privilege=”Read” />

In this example, the Subarea nav_reports will be shown only to users with grants to Read reports. You can use any entity to perform this restriction .

Areas , Groups , Subareas of the Sitemap


Using this same file you can change the names and links of any area ,group or subarea.

If you want to edit the SiteMap using JavaScript you can read this post about it.

Thanks for reading and have a nice day.