Based on “Entity” in Dynamics 365 Sharepoint integration

Follow Debajit’s Power Apps & Dynamics 365 Blog on WordPress.com

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.

image

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.

image

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

image

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.

image

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.

image

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.

image

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

image
image
image

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.

image

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

image

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.

image

Hope this helps!

Debajit Dutta

(Dynamics MVP)

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