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:

https://blogs.msdn.com/b/crm/archive/2010/10/08/crm-with-sharepoint-integration-introduction.aspx

https://blog.pointbeyond.com/2011/04/30/integrating-sharepoint-2010-with-crm-2011-for-document-storage/

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:

image

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:

image

Completing the configuration of Document Management in CRM

image

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:

image

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:

image

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

image

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.

image

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.

image

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:

image

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’:

image

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:

image

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.

image

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]

image

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.

Conclusion

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

Dynamics 365 Marketing vs ClickDimensions It’s time to pause, reflect and acknowledge a new era of inclusivity and collaboration. Part 2 - How to get the most from a Technology Expert – Asset Management Hub Property & Asset Management Hub Part 1 – Balancing CRM and Asset Management Scopes - Asset Management Hub Creating a Multi-Lingual PowerApps Portal How to Set Up a Microsoft Teams Site Using DocDrive365 Microsoft Teams - Adding a Microsoft Teams URL to a Dynamics Appointment Dynamics 365 Marketing – Customer Voice Survey Not Appearing In Emails? Using SQL Management Studio to connect to the Dynamics DB Calling a Power Platform AI Builder Model via oData How to use DocDrive365 to integrate permissions between Business Units in Dynamics with Sites in SharePoint Getting started with the Power Platform AI Builder. Power Apps Portal Information Hub DocDrive365 Security: Day One - Getting Started with Dynamics to SharePoint Permissions Part 5 - Power Apps Portals: How To Connect Azure B2C With Linked-In Part 4 – Power Apps Portals: Styling Azure B2C for Power Apps Portals The 3 Phases for Using Multi-Select Option Sets in Flow with Microsoft Forms Part 3 – PowerApps Portals: Azure B2C and Power Apps Portals – User Flow for Signup and Signin Part 2 - Power Apps Portals: New Application Registration in Azure B2C for our Power Apps Portal Part 1 – Power Apps Portals: Creating a New Azure AD B2C Tenant The Automation Bot: Launching Contextual Flow from Teams Creating a New Bot for Teams Debugging your Teams Bot using Ngrok Adding a Microsoft Teams URL to a Dynamics Appointment
Contact Us

Want expert advice or a demo?

Get in touch now and see how we can help your business grow.

  • Name
  • Email Address
  • Phone Number
 
Close

Understanding Your Challenges

Our strong understanding of CRM and emerging technologies within the Microsoft environment means we deliver the right solutions for you.

Proven Real-World Solutions

As a leader in the field of Dynamics solutions, our pedigree developing and delivering real-world solutions is unsurpassed.

Long Term Support

We provide support beyond our design, implementation and 'go-live' delivery using Sprints and continual updates to our AppSource apps.

CRMCS | Design by Thinktank Marketing | Citrus-Lime Limited

To improve your experience today and in the future, this site uses cookies. Read our full Privacy Policy & Cookie information here I Understand