CRM 2011 and SharePoint 2010 Integration - Part 1

(Post courtesy of Anand Nigam)

Hi SharePoint Folks,

I am back with yet another post, this time I will focus on an evergreen subject, Integration between SharePoint and CRM 2011 ? This is a huge topic as there are many possibilities. To have a better clarity on each of the Integration point, I’m going to split the post basis on the integration point covered.

  • Part 1: Introduction and CRM 2011 - Document management Integration with SharePoint 2010 (This post)
  • Part 2: Reporting CRM data in SharePoint using Excel services
  • Part 3: Publishing CRM entities in SharePoint.
  • Part 4: Search CRM entities from SharePoint Enterprise Search.

The word you are thinking is “awesome”, well I know Smile ,

Let’s cut short the talking and make it work, get ready!

CRM 2011 - Document management with SharePoint 2010

So below is what you will need

    • CRM 2011 deployment and some sample data (I populated my CRM with built in sample data).
    • A SharePoint 2010 farm, with a web app created
    • This post

In CRM 2011, document management feature comes OOB. This makes it very easy to setup document management as compared to CRM4. Once we are able to setup this up, a CRM 2011 user can create, upload, download, modify etc. to the documents/content in SharePoint without leaving the CRM UI, AND without using “not so good looking“ IFRAME method. Moreover it’s easy to pull administrative information too, All with minimal efforts Smile

So here is my CRM


And here is my SharePoint


To actually integrate the two we have to complete 2 tasks :

1. Make SharePoint aware that CRM is going to speak to it. This is done by an add-on, which is essentially a sandbox solution, Please be aware, Sandbox solution has a restriction to work within the site collection, so if your need is to use multiple SharePoint site collection for integrating with CRM, you have to install the sandbox solution on each of the them.

Also Note – I am not talking about subsite, I am talking about site collection.

2. Configure CRM to use SharePoint as the backend document server. This is done simply by configuring the SharePoint site collection URL in the CRM document management’s settings page.

1. On SharePoint – “Make SharePoint aware that CRM is going to speak to it

Step 1 – Log in to any (if you have multiple servers in SharePoint farm, just take any APPLICATION server) SharePoint server with the farm service account –

Download the List component here

Step 2 – Extract the files,

Double click the installer


Read and understand and if you accept the terms tick mark and continue


Select the Location for extraction


Once successfully extracted open the location (“c:\CRM List Component\” in my case)

You will see 3 files, just 2 of them are important.

1 – AllowHtcExtn.ps1 – this is the PowerShell script, which “Allows” SharePoint to allow users to use .htc files. In simple words, SharePoint does not by default allows all the file types to be Opened from within SharePoint. Consider this - if you an html file with JavaScript, this file is in SharePoint, and you open it, the browser will render the JavaScript in the html file, which means if the JavaScript is a malicious one, there is a possibility of damage. So to protect clients SharePoint does not lets you open, but gives you option to save it on your disk. With this PowerShell script we will add the .htc file to the list of allowed once. To view all the “Allowed” files run the:

$WebApp = Get-SPWebApplication –identity <url of your webapp>


2 – crmlistcomponent.wsp - this is the solution, that we will upload to the SharePoint site solution gallery that will enable SharePoint to “Speak” with CRM

Easy till here? The next part is easy too !


Now Open SharePoint central administration site. Navigate to System Settings > Manage Services on Server > Look for “Microsoft SharePoint foundation Sandboxed Code Service”, now Click on Start. On a “Not so important” note - it’s always a good idea/best practice to turn on the services on multiple servers.


Ensure that you have started it , otherwise the sandbox solution WILL not work. Ok once this is done open services.msc and ensure the service “SharePoint 2010 User Code Host” is “started”. Not doing these steps are the most common reasons why many get error when they try to Activate the solution.


Now Open the SharePoint site and navigate to the site collection where you want CRM to push the data. In my case I have a default site collection “/” so I will navigate to it in the browser.


Navigate to Site Action> Site Settings > Solutions (Under Galleries)



Upload > and point to crmlistcomponent.wsp


Now click Activate.


On successful activation click on the solution once and ensure that your window looks similar to the one below. I get Deactivate options confirms the solution is successfully activated Smile


Now Time to run the script

Fire up the SharePoint management shell > navigate to the AllowHtcExtn.ps1 location and run it in the below way

> AllowHtcExtn.ps1 <site collection url>

Eg > AllowHtcExtn.ps1 https://app1/

Successful run will show you a similar window


2. On CRM Server –“Configure CRM to use SharePoint as the backend document server

Step 1- Open CRM 2011 Site > Settings (at bottom of the image)


Click on Document management > click Document Management Settings


Now in the following window tick mark those entities where you WANT to have Document management Option. Eg :- if you only want “Account” entity to have the option to upload and download document select it, if you want document management on other entities like Order, Price List , Contract etc. just select it. By default Account, Article, Lead, Opportunity, Product, Quote and Sales Literature are already selected.

Next Enter the site collection url in the URL box.


CRM now will validate if the sandbox solution is present in that site collection and once it detects its presence will it continue further


Now we are given an option to select – On which Entity should CRM create the folder structure? Based on accounts or Contacts ?


Once we click next it will prompt to create the document libraries in SharePoint, say Ok , and it finishes with a charm.


Since we went with default entities, we got 7 libraries created in SharePoint


And with that last click we are Done !!! Time for testing.
See it in Action

Open the CRM workspace> Open aAccount.

Click on Documents menu on the left and you will receive a prompt (it says that I’m going to create a folder with the account’s name) say Ok


We got the library created


Add a document to this


You will see it below like this


If I now do the same operation for the entity Opportunity I will see the documents in a folder name Opportunity under the account library.

That's it !, we are done with the Document management integration of CRM 2011 and SharePoint 2010, wasn’t that easy?

Good to know -

1. Finally All the feature of document management server is provided in the CRM UI itself


  1. Navigate up – For navigating up in the SharePoint location
  2. Create folder – create a new folder in SharePoint
  3. New document - Requires Office 07/10 installed on client, for win2008 Desktop experience feature is required
  4. Upload – upload a document
  5. Edit document – Edit in office application, Office client must be installed on the client
  6. Delete document – Deletes from SharePoint
  7. Open the SharePoint site – Opens in another window the SharePoint site
  8. Check Out – Exclusively lock the document for yourself
  9. Check In – After edit is done check in to commit your change or unlock the document
  10. Discard Check out- Discard whatever you did after checkout
  11. Set alert on SharePoint – subscribe to email alerts on events on the document (eg,: document change, deleted )
  12. Download document – download a copy of the document locally
  13. Copy Shortcut – get the document url in clipboard
  14. Send Shortcut – needs outlook installed on client
  15. View Properties – view the metadata (date modified, author, last modified by, last modified date etc)
  16. Edit Properties – edit the metadata
  17. Versions – Shows different versions of document from previous edits

2. If you DO NOT have list component on SharePoint still you can use the SharePoint libraries to store document. When you will use the documents option in the CRM entity it will ask you for a SharePoint library, Which CRM will show you in an IFRAME (like the good old days of CRM 4 with IFRAME of SharePoint library). CRM 2011 does the IFRAME configuration automatically.


Enter the absolute URL of the SharePoint library and you will see it in IFRAME


Now click save and see the library in IFRAMEJ.


3. On the entities we can see the option “Add Location”, this way we can have multiple locations added for content storage, it can be another SharePoint site or a different URL.


Notice the URL of the SharePoint, it’s a sub site, OR you could use another folder too. My intention is to have a separate folder for contract documents and another folder for other type of documents.


The result is – the users get the drop down to select where he wants to upload the document.


4. The Edit Location button will give us option to alter the location of the SharePoint folder.


5. Something that you must know .The Option to Remove / Delete added location is nowhere here. You must navigate to Document management settings > SharePoint Document Location. Remember this is the only place where you can see all the SharePoint sites currently used by CRM.

6. clip_image057

I hope you liked the post. I will be back with other parts soon !

Questions/feedback are welcome