Monday, May 21, 2012

Integrating with Sharepoint

With the new built in integration of sharepoint list mode, crm offers the capability to integrate with sharepoint. However we are are often stuck with the builtin tool to create teh sharepoint folders which are not effective. So I am presenting a solution to automate the integration. In my previous post we have created a plugin to generate autonumber. We will use this to create the sharepoint folder.

Remember
1. Update the sharepoint site URL
2. If you want to use the defaults, update the GUID from your database
3. Remember to use the entity names as display names in sharepoint site

Assumption
1. Sharepoint site already created
2. Document libraries are created for each entity in CRM that integrated with sharepoint
(Created by default when you enable storing documents in shrepoint)


The below code will generate the sharepoint structure as below
spsite/entity/unique-identifier

If the folder already exists in sharepoint, it just links the folder in CRM else it creates the folder in Sharepoint and then created the document locations in CRM. You can customize in the code on which fileld to be used for the document location "GetSharepointAttribute(string EntityName)". Update this function to reflect your needs