{Dynamics 365 + Sharepoint} Sharepoint folder naming issue in CRM-Sharepoint OOB integration when Primary attribute is more than 128 characters

CRM-Sharepoint integration – This topic has certainly lost the steam by now and anybody working in dynamics over the last 7-8 years have tried it out so many times. Done and dusted topic, isn’t it?

But just when I think I know it all, Dynamics surprises me with some hidden nuances and my today’s post is on it.

So here I was, setting up the mundane CRM-Sharepoint OOB integration and directly set-it up in client’s production environment. OOB feature, no testing required. But suddenly one issue reported by customer – “My two records in account are sharing the same folder in Sharepoint”.

But how is that possible? A little bit of digging and this is what I found out.

In Dynamics CRM – Sharepoint integration, the folder gets formed in the format – Primary Attribute Field value_<Guid>. So if for an account record, it would be <account name>_<account guid>.

Now let’s play around with the Account Name.

This is below account name I have given for one record.

“the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog.”

Below is the name for other account record.

“the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. lorem ipsum dolor sit amet.”. Notice the part in bold I have changed from the previous account.


Now, let’s go and see the folder created for the first account record.


There is no guid in the folder name. The reason is in OOB integration, folder name limit is always 128 characters. So if primary attribute name length is more than 128 characters, it would be trimmed to 128 characters and then the folder name is formed. So first lesson learnt, the Guid is not mandatory in the folder naming in Sharepoint for CRM-Sharepoint OOB integration.

Now it’s obvious that this is a potential root-case of problems. I also uploaded one document for this record and as you can see from the screenshot.

Lets go ahead and see the folder created for record 2.



As you can see from the above screenshot, the folder name for record 2 is also mapped to the folder for record 1. This is because the first 128 characters for both the account records are same. Hence the same folder got created. And as you can see, although I have not uploaded any file in record 2, still the file uploaded in record 1 is visible here.

This can be a potential problem.

Hope this helps!


Debajit Dutta

(Dynamics MVP)

For training/ consulting/ tools please visit our website www.xrmforyou.com or write to us at – info@xrmforyou.com

Author: Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 12 years of experience in Microsoft .NET Technologies and 9 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website 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