Tuesday, 1 November 2011

CRM 2011 Mail Merge in web client -- CRM Add-In missing

Hi All,
Recently I had to use mail merge for a client without having outlook client installed.
Whenever I create a mail merge from web client, I don't seem to see the CRM add-ins under Add-ins tab. Then after doing some reaearch, I found that you need to have an entry in the host file, which is located at C:\Windows\System32\drivers\etc location on win 7 machine.
Just add an entry to your CRM IP address and name in a new line in this file.
For example, if your server IP is and name is crmappserver, then add a new line with and press tab and then enter crmappserver.
Save the file and open the CRM in IE. Create a mail merge template and now you should be able to see the CRM add-in button.

Friday, 12 August 2011

How to generate ClientCredentials as devicecredentials


To register the device using Device Registration Tool Provided in the SDK, Open the command prompt and go to the location of the deviceregistration.exe and then run with the following command. You can find this file in the CRM 2011 sdk i.e. sdk\tools\deviceregistration\bin\Debug

C:\>deviceregistration.exe /operation:Register

This will register you device and give Device Username and Device Password.

The CRM 2011 online supports only claim based authentication so the device username and the password is very important and a necessary component for generating the code{class} for using the Organization Service data and metadata.

Here is an excellent article on this.

CRM Online : How to Authenticate and create Organization service


Here is the code to authenticate and create the Organization service for CRM online 2011.

References used to ClientCredentials using System.ServiceModel.Description

and the code is
Uri HomeRealmUri = null;
ClientCredentials devicecredentials = new ClientCredentials();
devicecredentials.UserName.UserName = "<>";
devicecredentials.UserName.Password = "<>";

ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "<>";
credentials.UserName.Password = "<>";
Uri organizationUri = new Uri("<>");

OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(organizationUri, HomeRealmUri, credentials, devicecredentials)

Microsoft.Xrm.Sdk.IOrganizationService service = (Microsoft.Xrm.Sdk.IOrganizationService)serviceProxy;

Read my another blog on how to generate devicecredentials.

Hope this helps.


Tuesday, 14 June 2011

Error when registering Custom Workflow plugin in MS CRM 2011

There are some security restriction while registering plugins for MS CRM 2011 that enables only privileged users to register plug-ins.

For plug-ins that are not registered in isolation, the system user account under which the plug-in is being registered must exist in the Deployment Administrators group of Deployment Manager. Only the System Administrator user account or any user account included in the Deployment Administrators group can run Deployment Manager.

For non-isolated plug-ins, failure to include the registering user account in the Deployment Administrators group results in an exception being thrown during plug-in registration. The exception description states "Not have enough privilege to complete Create operation for an SDK entity."

The system user account under which the plug-in is being registered must have the following organization wide security privileges:






The System Administrator role has these privileges. For more information, see Security Role and Privilege Reference and The Security Model of Microsoft Dynamics CRM.

For plug-ins registered in the sandbox (isolation mode), the system user account under which the plug-in is being registered must have the System Administrator role. Membership in the Deployment Administrators group is not required.

Please read this Article for Registering and Deploying Plug-ins in MS CRM 2011 using plugin registration tool.


Customer Field in MS CRM 2011

Hi All,
It's been a long time since I posted anything. Now I found something interesting, which I thought should go here as I did not find anything related to customer field for MS CRM 2011 on the net.

You all must have seen the customer field in MS CRM 4.0. But it's a bit differnt to implement it in CRM 2011. I took some hint from http://www.stunnware.com/crm2/topic.aspx?id=js34 as to how it was done in CRM 4.0 and then modified the code to make it work for CRM 2011.

Here is the code.
//Code for Form Onload Event

function OnLoad() {
crmForm.all.tsf_supporterid_c.style.visibility = 'hidden';
crmForm.all.tsf_supporterid_d.style.visibility = 'hidden';

var accountLookup = Xrm.Page.getAttribute("tsf_accountsupporterid");
var contactLookup = Xrm.Page.getAttribute("tsf_supporterid");

// Set the available lookup types to account and contact.

document.getElementById("tsf_accountsupporterid").setAttribute('lookuptypes', "1,2");
document.getElementById("tsf_accountsupporterid").setAttribute('lookuptypenames', "account:1:company,contact:2:person");
document.getElementById("tsf_accountsupporterid").setAttribute('lookuptypeIcons', "/_imgs/ico_16_1.gif:/_imgs/ico_16_2.gif");

var lookupAcc = new Array();
var lookupCon = new Array();
lookupAcc = accountLookup.getValue();
lookupCon = contactLookup.getValue();

if (lookupCon != null) {
accountLookup.DefaultValue = contactLookup.getValue();
var custom = new Array();
custom[0] = new Object();
custom[0].name = lookupCon[0].name;
custom[0].id = lookupCon[0].id;
custom[0].typename = "contact";

document.getElementById("tsf_accountsupporterid").setAttribute('defaulttype', "2");

//Code for Form OnSave Event
function OnSave() {
var accountLookup = Xrm.Page.getAttribute("tsf_accountsupporterid");
var contactLookup = Xrm.Page.getAttribute("tsf_supporterid");

if (accountLookup.getValue() == null) {
else {
var customer = new Array();
customer = accountLookup.getValue();
// A type code of 1 represents an account.
if (customer[0].type == "1") {
// If it is an account, then clear the contact lookup.
else {
// A contact was selected, so copy the value to the contact lookup and clear the account lookup.
var cust = new Array();
cust[0] = new Object();
cust[0].name = customer[0].name;
cust[0].id = customer[0].id;
cust[0].typename = "contact";

document.getElementById("tsf_accountsupporterid").setAttribute('defaulttype', "2");



Friday, 7 May 2010

Embed SQL Server Reporting Services reports into your CRM forms


There is a great article on How you can embed SQL Server Reporting Services reports into your CRM forms.
Click here to see the article.


Wednesday, 14 April 2010

Microsoft Dynamics CRM Demonstration Tools


Microsoft Dynamics CRM Demonstration Tools (for Microsoft Dynamics CRM 4.0) has been released, which provide a simple user interface that allows you to easily enter and edit data to populate or modify your instance of Microsoft Dynamics CRM. It also allows you to load and store your data in XML format, so that you can reuse your data in the future.

You can download the tool from here.

Please note that these tools are for partner demonstrations only, and are not supported through Microsoft Technical Support.


Wednesday, 3 March 2010

Invalid Argument error when Importing Customization in MS CRM 4.0


Sometime you get the Invalid Argument error, when importing customizations from another instance.

The prime reason of this could be you have exported the customization file before published. You can always go back, publish the customization file and export-import again.

That should work most of the time. But did not work for me.

On importing the customization file, I was getting error Failure:<<relationship attrubute name>>: Invalid Argument. So i opened the exported xml file in notepad and searched for the Relationship Attrubute name, which will look something like
<entityrelationship name="<<Attrubute name>>">

In this section, you will have a section similar to the below

<field name="<<field name">> requiredlevel="none" imemode="auto" lookupstyle="single" lookupbrowse="0">
<displaynames />

Replace <displaynames />with
<displaynames><displayname description="<<Any description>>" languagecode="1033"></displaynames>

Now save the file and import again. It should work this time....

Also read the article on same issue http://mscrmuk.blogspot.com/2008/12/invalid-argument-error-when-importing.html .

Hope this helps...


Friday, 19 February 2010

Remove Add Existing button

HideAssociatedViewButtons(['Add Entity Name'],['Add record ID']);

function HideAssociatedViewButtons(leadAreaId, buttonTitles)
var navElement = document.getElementById('nav_' + loadAreaId);
if (navElement != null)
navElement.onclick = function LoadAreaOverride()
HideViewButtons(document.getElementById(loadAreaId + 'Frame'), buttonTitles);

function HideViewButtons(iFrame, buttonTitles)
if (iFrame != null)
iFrame.onreadystatechange = function HideTitlesButtons()
if (iFrame.readystate == 'complete')
var iFrame = frames[window.event.srcElement.id];
var LiElements = iFrame.document.getElementsByTagName('li');
for (var j=0; j< buttonTitles.lenght; j++)
for (var i=0; i< liElements.length;i++)
if (liElements[i].getAttribute('title') == buttonTitles[j])
lielements[i].style.display ='none';


Thursday, 4 February 2010

CRM 4.0 outlook client performace issue


Many of you must have encounterd CRM 4.0 outlook client performance issue. CRM in outlook client works very slowely and takes more than a min just to open a record.

There are various blogs and articles available on that. Microsoft has also launched a lot of patches to fix this issue. Reviewed this white paper, which provided a number of best practices for optimizing and maintaining Microsoft Dynamics CRM. But these patches and articles works for specific issues in crm for outlook client.

Recently i also had the same issue with all the users for a client. CRM works fine in web browser, but crawls in outlook client. I did a lot of research, tried all the hotfixes, unistall and reinstall CRM for outlook client many times. But nothing worked.

Then by chance i thought to look at the rgistery on the client machine as whats been created in MSCRMClient folder at HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient and found that the value for ServerURL and WebAppURL keys was not correct.

I tried to browse the URL mentioned in these keys through web browser and guess what response was same as i was experiencing in outlook client. Very very slow.............Although it opened the application, but took a long time to open the default page.

Then i changed the URL in these keys to the actual CRM URL, we use to browse in web browser, restarted my outlook and CRM works like a treat. It was working same as it is working in web browser. This may not apply to everyone, but worth checking these two key values on client machine.

May be this fix your problem too...