Understanding SharePoint Document Locations for Entity based folder structure–Dynamics CRM + SharePoint integration

Recently I was handling a training in Dynamics where I was demoing the OOB CRM SharePoint integration.

Client was already using the OOB CRM-SharePoint configuration using entity based folder structure. Anyone getting confused what is meant by entity based folder structure? Well while configuring you get an option to select whether based on Account/ Contact.

I selected Account here. Not a big deal.


But here it gets interesting. What if I upload some documents for a child record of an account and then change the account for that child record?

To duplicate this, I followed the below steps

  • Created two accounts – Account A & Account B
  • Created a case – Case | Document Test for Account A
  • In the Documents Section, uploaded file named – Document 1.txt

Let’ see the folder structure in SharePoint after this operation.


No surprises here. As we have chosen Entity based folder structure, the document got uploaded for the case under the account for which the case has been logged.

Now let’s go ahead and changed the account of the case to Account B


Now if we go ahead an upload a Document for the case – Document 2.txt, it should roll up under Account B. Let’s see that if it happens.

I go ahead and upload the document. But surprisingly it is still uploading under Account A in SharePoint.



Strange isn’t it? But why it happens? To understand this we need to understand the Document Locations record that CRM uses to map to the corresponding folder in SharePoint.

The following are the document locations record that got created after we uploaded Document 1.txt.


As you can see, four document location records got created

  • One for entity – account
  • One for account record – Account A
  • One for entity – (case)incident
  • One for case record – Case| Document Test

As you can see all are named “Document on Default Site 1”. This is confusing. So let’s name it accordingly.

Below is the screenshot after renaming. Probably looks simpler now with the names.


Looks go ahead and create the document location record manually for Account B.







If you now come back to the Case record and move to the Documents section, you will find two document locations now but if you select the Account B Document Location record, you will find no upload button.


This is because the corresponding folder in SharePoint does not exist. Lets go and create that.



Now if you go ahead to the case and move to the Documents section, you would find both the Document Locations for previous and current account.

And if you now upload a document to the case for the current account, it goes and sits at the right place. And you can always switch back to see what were the documents uploaded for the previous account as well.


Hope this helps!


Debajit Dutta

(Dynamics MVP)

For training/ consulting/ tools, please visit www.xrmforyou.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s