Support Portal ContactGet in touch

CRM 2011 Integration with SharePoint: Taking a Deeper Look

   Words by CRM Consultancy

   on 23/10/2011 10:00:00

One of the best new additions to CRM 2011 is tight integration with SharePoint 2010 for storing documents.  In the past when using v3 or v4, CRM Projects have been forced to develop custom code to integrate CRM with SharePoint, but now the standard CRM functionality allows the two products to be integrated and easily configured in the CRM 2011 settings area.

Following the CTP and release of 2011 at the beginning of this year, many great articles have been written and posted on the web to provide step-by-step guides for connecting CRM to SharePoint using this functionality:

However as with many areas of ‘out-of-the-box’ functionality the default integration is limited in certain ways.  This article aims to take a deeper look at this integration between CRM 2011 and SharePoint to examine how the integration works ‘under the hood’; with the aim of understanding how CRM 2011 has implemented this integration and how it could be extended further to meet the requirements of more complex Document Management scenarios.

The Standard CRM and SharePoint Document Integration

By default whenever CRM 2011 has been correctly configured to work with SharePoint 2010, an admin user will be able select which CRM Entities should have SharePoint document areas:


Configuring Document Management Settings in CRM 2011 by selecting which entities should have a Document Library Folder

Selecting these entities will then have the effect of creating a SharePoint Document Library for each entity:


Completing the configuration of Document Management in CRM


The resulting Document Libraries creating in SharePoint as a result of configuring CRM 2011's Document Management settings.

Within CRM this will also create a reference in the CRM Database’s Share Point Site table to record that this SharePoint Site will be used for document management – essentially storing the details required to link CRM and SharePoint in this record for reference.  We can see this record via a simple Advanced Find in CRM on the ‘SharePoint Sites’ entity:


Running an Advanced Find in CRM for the 'SharePoint Sites' entity to return a single record detailing the settings configured for Document Management with SharePoint

To fully understand how this is connecting the two systems, it can be useful to look at how CRM has populated the fields for this record as the placeholder that CRM has created to act as a pointer to SharePoint:


We can also open this record in a similar fashion to any other CRM record:


Opening the SharePoint Site record in CRM

With this in place, we can now browse to any valid CRM Record for the entities selected for Document Management and click ‘Documents’ to begin creating or uploading documents against that record.


Accessing the Documents area for a CRM Record which does not have an associated SharePoint Document Location record - prompting CRM to offer the option of creating a new folder in SharePoint.

This prompts CRM to create a new SharePoint Folder in the Document Library for the entity type of the record – typically the Account entity in many business cases.


The resulting folder for the CRM Account Record created in the 'account' Document Library in SharePoint

With this folder being directly accessible from within CRM via the SharePoint List Component:


The Documents area in CRM showing the Documents contained in SharePoint for the highlighted 'Documents on Default Site 1' SharePoint Document Location record.

Behind the scenes here CRM has taken the step of invoking SharePoint to create a new folder for the Account record and adding a reference in the CRM Database to link the Account record to this particular SharePoint Document Location.

Again we can view this reference record in the CRM Database via a simple Advanced Find, this time on the ‘SharePoint Document Locations’ entity in CRM’:


Running an Advanced Find in CRM against the 'SharePoint Document Locations' entity

This list of Document Locations shows the references that CRM has created to external SharePoint Locations for storing documents.  In this case, a reference to declare that documents for the ‘Account’ entity will be stored at the relative URL for ‘account’ and a second reference to declare that documents for the ‘CRM Consultancy’ Account record will be stored at the relative URL for ‘CRM Consultancy’.

As this 2nd reference has a parent link to the 1st, this makes the relative URL ‘account\CRM Consultancy’ – and in turn, the 1st Document Location is linked back to the earlier SharePoint Site record and as such the URL is determined as:

[Site Absolute URL] –> [Location 1 Relative URL] –> [Location 2 Relative URL]

In this case ‘https://mySharePointServer/mySite/account/CRM Consultancy’.

We can look at this as a simple ERD Diagram to show the relationships between the entities in CRM and SharePoint:

Document Management ERD between CRM and SharePoint

Entity Relationship Diagram to show the connection between CRM and SharePoint via the SharePoint Site and SharePoint Document Management Entities

Opening the child Document Location record, we can see these links in a similar fashion to any other Parent/Child Lookup relationship in CRM:


Opening the SharePoint Document Location record that links an Account to a folder in SharePoint inside CRM.

Looking at the fields for the SharePoint Document Location entity, we can see that these are very similar to the SharePoint Site entity – particularly when thinking of the AbsoluteUrl/RelativeUrl fields.


This series of Site/Location records informs CRM where to look in SharePoint when showing the list of Documents for a record, building a URL from the various levels of relative URLs involved back to the root absolute URL.  This is best expressed by the following Record Relationship Diagram that shows how this functions for an Account in CRM:

CRM - SharePoint Record Relationship Diagram I

Record Relationship Diagram to show how the SharePoint Document Location records associate the Account in CRM to a specific folder within SharePoint

This basic structure of Document Management allows a CRM Users to add new Document Areas for an Account and record Account-based documents directly through CRM.

Folder Structure Entity

The structure above can be extended via the Document Management configuration in CRM to allow for sub-folders from the initial Account folder down to sub-entities such as Contact.  This enables documents to be stored in a nested structure to allow CRM Users to store documents against a Contact or other entity which is in turn linked back to the ‘header’ Account.

Therefore the Record Relationship Diagram would be extended to:

CRM - SharePoint Record Relationship Diagram II

Record Relationship Diagram to show how CRM tracks a variety of SharePoint Document Location records to associate the connected Account and Contact to different linked areas within SharePoint

In this example, the Contact entity could be any entity in CRM that is related to the root Account entity – so we could have additional folders for Opportunity, Order or Case for example.

This extended structure stems from the ‘Folder Structure Entity’ field of the SharePoint Site record, this field can be set to either None, Account or Contact to specify the top-level entity for managing documents.

This defines more complex nested sets of Document Location records in CRM:

[Site Absolute URL] –> [Location 1 Relative URL for Folder Structure Entity] –> [Location 2 Relative URL for Record] –> [Location 3 Relative URL for Sub-Entity] –> [Location 4 Relative URL for Related Record]


Looking at the list of SharePoint Document Location records for tracking locations for a Contact attached to a Account when the Account entity is acting as the Folder Structure Entity

This allows CRM to cater for business models where the top-level Customer may be an Account (for business-to-business) or Contact (for business-to-consumer) in a similar fashion to how CRM allows Opportunities or Orders to be linked to either an Account or Contact.

However by default this is restricted to Accounts and Contacts, we could not have a custom entity or other system entity acting as the Folder Structure Entity – however this does show the flexibilty that Microsoft have built into the concept of Sites and Document Locations.


The crucial understanding here is that this structure of a Document Library per Entity Type with Folder per Entity Record is simply the default business logic provided by CRM 2011 – and is in no way set in stone as the functionality provided by the SharePoint Site and Document Location entities in CRM can easily be extended to provide bespoke business logic for tracking documents.

As with many areas of Dynamics CRM, the application here provides a platform of functionality that can either be used in it’s default configuration or be extended via custom development.

In terms of why we may want to do this, when we look at the standard SharePoint integration here we can see some limitations for Document Management:

  • a single Document Library is storing all the CRM Documents, this could result in a single huge Document Library when it may be better to spread out the documents across multiple document libraries.
  • the Document Structure is heavily dependent on nested folders, this can often create a confusing layout for storing documents; and long-time SharePoint experts generally shy away from heavy use of folders for creating good Document Management governance. (SharePoint Document Libraries and Horrors)
  • Without customising the Document Library in SharePoint, the Document Structure does not make use of SharePoint Views or Metadata for managing documents.

The next post in this series will attempt to show how we can incorporate these concepts into CRM using custom development that uses and builds on these concepts to provide a custom model for managing documents between CRM and SharePoint.

Share this Article

Search Articles

Filter Articles

CRM Tech DocMan

Recent Articles

CRMCS Quick Start Guide: How To Produce a Microsoft Teams Live Event Dynamics 365 Marketing: Lead Scoring and Sales Acceptance Designing and Developing Microsoft Power Apps Portals Thank You for Attending CRMCS’ Webinar - Achieving B2B sales excellence with Dynamics 365 & Microsoft Teams Thank You for Attending Our Webinar - Achieving B2B sales excellence with Dynamics 365 & Microsoft Teams Webinar: Discover How CRMCS Have United Dynamics 365, SharePoint and Microsoft Teams To Create Sales Excellence Ignite your workflow by adding DocDrive365 to Office 365 The CRMCS guide to everything you need to know about integrating Teams with Dynamics 365 Saving Time By Keeping Documents In One Place TDE Database Encryption with On Premise Dynamics The Key to Successful Compliance in 2020 Part 2: Let’s get GDPR Compliant with Microsoft Power Automate Top 3 Essential Tips for Remote Working Dynamics 365 Marketing: Top 5 Best Features Dynamics Day in the Life - Puma Investments Can you use Teams to amplify collaboration in Dynamics? Part 1: Using a Scheduled Power Automate to Trigger Expiry Date Reminders The secrets of successful document collaboration in Dynamics CRMCS launches new AppSource approved DocDrive365 Dynamics Day in the Life - Moneypenny Release Management Add the App to Dynamics DocDrive365 Security: Day One - Getting Started with Dynamics to SharePoint Permissions Building a New Scheduled Process using Flow
  • "Paul has made a real difference to how my team of 24 people record and store valuable customer data and sales opportunities. Highly recommended."

    James, Operations Director

  • "Understanding your business allows us to advise when to implement aspects of CRM and, likewise, when not to."

    Paul McQuillan, Managing Director

  • "Dynamics 365 and CRMCS have made a real lasting difference to our business, allowing us to replace older systems that were holding back our performance."

    Grahame, Chief Operating Officer

  • "James worked well with us to help connect CRM with Outlook and relate how this might benefit our team using CRM for Property Care."

    Natalie, Property Care Supervisor

  • "Matt was really good with helping us run User Testing on the new Compliance Module of our CRM System."

    Tom, Compliance Administrator

Prefer to go old-school?

Write to us using the below addresses.

Head Office
CRM Consultancy
61 Oxford Street
M1 6EQ

London Office
CRM Consultancy London
Grosvenor Avenue

Content © CRM Consultancy.