(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.
The word you are thinking is “awesome”, well I know ,
Let’s cut short the talking and make it work, get ready!
So below is what you will need
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
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. 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.
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 http://www.microsoft.com/download/en/details.aspx?id=5283
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.
$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
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 http://app1/
Successful run will show you a similar window
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
Open the CRM workspace> Open a Account.
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?
1. Finally All the feature of document management server is provided in the CRM UI itself
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.
I hope you liked the post. I will be back with other parts soon !
Questions/feedback are welcome