Archive for June, 2012

Fix – Unable to add custom Report to the Solution in CRM 2011

June 30, 2012 1 comment

I have a custom SSRS report “ABC Report” in my CRM application.

ABC Report

ABC Report

And, I wanted to include this report in my solution “My Reports” and export to another CRM organization

But to my surprise, I did not find “ABC Report” when I choose “Solution -> Reports  ->  Add existing”

Add existing reports - solution

Add existing reports – solution

Fix :-

  • Go to “Work Place -> Reports”
  • Choose “ABC Report” and click “Edit”
  • In the report window go to “Administration” tab
  • Set Report “Viewable By” option to “Organization” and Save
Set “Viewable By” option to “Organization”
Set “Viewable By” option to “Organization”
  • Open the solution and click “Reports à Add existing reports”
"ABC Report" in the list

“ABC Report” in the list



Object doesn’t support this property or method XMLHttpRequest error – FIX


I was getting “object doesn’t support this property or method jquery” error when I was initializing

var request = new XMLHttpRequest();

Reason :-

  • This is a problem with Internet Explorer browser (ActiveX to be precise)

Fix :-

  • If the browser is detected as Internet Explorer, load ActiveX instead of XMLHttpRequest
  • Below condition check would solve the problem

var request;

if ($.browser.msie) {

request = new ActiveXObject(“Microsoft.XMLHTTP”);

} else {

request = new XMLHttpRequest();



Address entity in CRM 2011

June 24, 2012 1 comment

Below are few useful points about “Address“ in CRM

  • In CRM, “Account” and “Contact” entities have built-in fields to capture two sets of addresses.
    • These fields are address1_street1, address1_city, address1_stateorprovince, etc., as well as another whole set for address2 fields.
    • We normally assume that 2 default set of address fields have been added on the account/contact entity.
    • But this not really the case. All addresses are only stored in the “Customer Address” entity.
  • When you create a new account/contact, it would by default in the background add 2 records in the “Customer Address” entity for the 2 set of address fields available on the Account form.
    • CRM distinguishes these entries from the rest of the entries to be displayed in More addresses using the Address number column.
    • Address number 1 and 2 are reserved for the 2 set of address fields available on the account form.
Customer Address

Customer Address

  • Along with these 2 sets, we also have “More Addresses” link on the both Account\Contact navigation area
  • The first two Address records that the platform creates are hidden in the “More Addresses” associated view on the Account or Contact
  • Addresses are not available on Security Roles
  • You cannot update the Address record via workflow

Security Over Address :-

  • The security access to the Address entity is tied directly with that of “Account”entity.
    • e.g. For the Contact entity, the user will only be able to see the “More Addresses” in the left nav only if the user has “Read” access to the Account entity.
    • If you want to allow the user to “Add New Address” on the Contact form,
      • Grant “Create” and “Append” access for Account entity and “Append To” access on the Contact entity.
      • Granting “Write” access to Account entity will allow the user to edit the Addresses.


Checking whether user part of team using jscript CRM 2011

June 23, 2012 2 comments


We can verify whether the User is part of particular Team using jscript.

Below is the jscript function

function isUserPartOfTeam(userId, teamId) {

var oDataEndpointUrl = serverUrl + “/XRMServices/2011/OrganizationData.svc/”;

oDataEndpointUrl += “TeamMembershipSet?$select=BusinessUnitId&$filter=TeamId eq guid'” + teamId + “‘ SystemUserId eq guid'” + userId + “‘”;

var service = GetRequestObject();

if (service != null) {“GET”, oDataEndpointUrl, false);

service.setRequestHeader(“X-Requested-Width”, “XMLHttpRequest”);

service.setRequestHeader(“Accept”, “application/json,text/javascript, */*”);


var requestResults = eval(‘(‘ + service.responseText + ‘)’).d;

if (requestResults != null && requestResults.results.length > 0) {

return true;



return false;


How do I call this method :-

  • Pass User Id & Team Id to the function.
  • Function returns true/false

var userId={User GUID};

var teamId={Team GUID};

var flag= isUserPartOfTeam(userId, teamId);


Reading WCF client binding configurations from plug-in

June 16, 2012 1 comment

In one of my requirement I have to call my custom WCF service method from plug-in.

In this scenario my plug-in is WCF client and I have to read client binding configuration from plug-in.

Below are the ways you can read the binding configuration details from plug-in

  • Synchronous plug-in
    • In case of synchronous plug-in, you can place binding configuration in root <web.config> file of CRM application server
    • Open the Web.config from path “C:\Program Files\Microsoft Dynamics CRM\CRMWeb\web.config
    • Find <System.ServiceModel> node and place the client binding configuration
    • After placing the configuration, the <System.ServiceModel> looks as below
CRM root Web.config

CRM root Web.config

  • Asynchronous Plug-in
    • Since async plug-ins host on “CRM Async Service”, place the configuration details in “CrmAsyncService.exe.config” file
    • Open the “CrmAsyncService.exe.config” file from path “C:\Program Files\Microsoft Dynamics CRM\Server\bin\CrmAsyncService.exe.config
    • Add <System.ServiceModel> node and place the client binding configuration
    • After placing the configuration, the <System.ServiceModel> looks as below
CrmAsyncService.exe.config file

CrmAsyncService.exe.config file



Database ‘Org_MSCRM’ cannot be started in this edition of SQL Server because it contains a partition function ‘AuditPFN’ – Error while restoring organization

June 16, 2012 1 comment


I got below error, when I was trying to restore an organization database from SQL server enterprise edition to SQL server developer / Data center editions

Database ‘Org_MSCRM’ cannot be started in this edition of SQL Server because it contains a partition function ‘AuditPFN’. Only Enterprise edition of SQL Server supports partitioning.

Reason :-

  • When CRM 2011 is installed using a SQL Server Enterprise edition, a partition is automaticallycreated for the auditing functionality of CRM 2011.
  • The AuditBase table then uses partitioning (which is only available for SQL Server Enterprise).

Fix :-

  • Either upgrade current SQL version to Enterprise
  • OR
  • We have to run the script to recreate all the indexes on the Primary partition and then drops the partition
  • Refer below MSDN KB article

Below is the useful article on the same



Rename out of the box associated view ribbon buttons in CRM 2011


When we have relationship between two entities, the child entity link add to the left navigation of parent.

For example,

  • “Contacts” link add to the left navigation of “Accounts”
Contacts Associated View In Account

Contacts Associated View In Account

The view we call it as “Associate View” and it contains buttons with below naming convention

  • “Add {Display name of child}” (i.e., “Add Contact” in above screen)
  • “Add Existing {Display name of child}” (i.e., “Add Existing Contact” in above screen)

To rename the “Add & Add existing” buttons below are the steps

  • Create a new solution
  • Add child entity (i.e., Contact) in above example
  • Export & Save solution in local folder
  • Extract folder and open “Customizations.XML” in Visual Studio
  • Find <RibbonDiffXml><CustomActions> node
  • Add below XML

          <CustomAction Id=”Mscrm.SubGrid.{Entity Name}.AddNewStandard.CustomAction” Location=”Mscrm.SubGrid.{Entity Name}.AddNewStandard” Sequence=”210″>


<!–New Button Id – AddNewStandard; Existing Button Id – AddExistingStandard–>

<Button Id=”Mscrm.SubGrid.{Entity Name}.AddNewStandard



LabelText=”My Custom Text

Alt=”My Custom Text

Image16by16=”/_imgs/ribbon/NewRecord_16.png” Image32by32=”/_imgs/ribbon/newrecord32.png”

TemplateAlias=”o1″ ToolTipTitle=”Add New Contact”

ToolTipDescription=”$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddNewStandard_ToolTipDescription” />



  • Save, zip & Export solution