Before you get started, here are a few things to keep in mind.
With more and more companies adopting both Dynamics CRM and SharePoint into their corporate technology stacks, I’ve found myself integrating the two technologies more often than ever before. It’s quite cool. These are two extremely powerful systems and they both do what they are designed to do very well. I’m not going to go in-depth about what the differences are between these products…they are in totally different software “genres.” Apples and oranges. However, I want to point out one thing SharePoint gives you that many clients ask for again and again: Subsites.
Subsites are SharePoint sites that belong to a root SharePoint Site Collection. An example of this would be a corporate intranet SharePoint Site Collection (http://intranet) with SharePoint Subsites for each division in the corporation, e.g. Marketing (http://intranet/sites/marketing), Accounting (http://intranet/sites/accounting), etc. There are pros and cons to breaking these Subsites out into their own Site Collections (so they can have their own content database), but quite often you see this hierarchical approach.
Another very common use of SharePoint Subsites is for things like item level management, for instance a project. You may have a SharePoint Site Collection named Projects (http://projects), and you may require a new SharePoint Team Site for any new projects that come online so as to provide an environment where a team can collaborate on said project, and maintain any data or documents about the project in a central location. This can best be described with URLs —http://projects/sites/Project1, http://projects/sites/Project2 and so on.
So how does Dynamics CRM play into my scenario? What if you’d like to leverage this same functionality for things like Accounts, Contacts or Leads? Pick an Entity from CRM — for the purposes of this blog the Entity is somewhat arbitrary, but we’ll use the Account Entity so we have something to focus on. Every new Account I create may or may not require an environment where teams can collaborate and store data and documents for this new Account. Dynamics CRM gives us SharePoint Document Management out of the box. But what if I need more? What if my company maintains a site ‘template’ that can be used to create a new, standardized website (SharePoint Subsite) for any new Accounts that come online? A place where a team can collaborate and have the freedom to deal with unstructured data and content in a central location?
In this blog I’ll show you how to leverage the SharePoint Client Object Model in a Dynamics CRM Plugin to create a SharePoint Team Site for new Accounts that come online.
Microsoft Dynamics CRM 2011 has come a long way from its predecessors in many areas. For companies using both CRM 2011 and SharePoint 2010, the improvements can be appreciated even more since Dynamics CRM 2011 has native SharePoint 2010 document management capabilities right out of the box.
This functionality is apparent in a couple of different places in the CRM 2011 web interface. First, there is a page under the Settings section for Document Management. Second, some entities will have a Documents area available on their forms. Please see the screen shot in Figure 1 below. (Click on any image to see full-size.)
For this write-up, I’ll be focusing on the Document Management page and the required steps for configuring access to SharePoint 2010 as well as installing the SharePoint List Component.