Case Sensitivity in SharePoint Sites and Subsites

Printer-friendly version

I was recently working with integrating CRM and SharePoint using integration in a plugin/custom workflow assembly following the ideas outlined here and here.

In short, what I am doing is creating folders in a specified location whenever an account is created. Each account has an attribute on it, a reference to a custom entity called an "Area." An Area has a CRM SharePoint site record associated with it. We use that SharePoint site to determine where to create a folder in SharePoint. Technically, the CRM SharePoint record could be a site or subsite.

In my custom code, I read the area for the given account. So, for example, ABC Company is associated with the "Phoenix" area, which has an associated SharePoint site record with a URL to:

https://AdventureWorks.sharepoint.com/Northwind/Phoenix

That is a site (Northwind) and a subsite (Phoenix), but the URL is stored as an absolute URL on the SharePoint Site record, so it works.

While doing some string comparisons, I did a .ToLower() and wrote my final URL to a field on an entity which is displayed on a form with the string in its .ToLower() form. It looked like this:

https://AdventureWorks.sharepoint.com/northwind/phoenix/AccountName_AccountGuid

When I clicked on that link inside CRM, it failed. I looked in SharePoint and the folder existed. The names were right. I was getting frustrated when I compared a working URL and non-working URL in Notepad and saw they were exactly the same and for some reason, one URL still didn't work. Then I noticed that they weren't exactly the same: "Northwind" and "Phoenix" were lower case, whereas on the SharePoint site record they were capitalized. I thought to myself, "That can't be it. Why would a URL be case sensitive?" Well, it is. As soon as I changed the URL to:

https://AdventureWorks.sharepoint.com/Northwind/Phoenix/AccountName_AccountGuid

it started working.

I can't explain why, but since SharePoint is involved in the process of handling the URL, for some reason it's case sensitive and so if you're doing a string comparison in C# code in a plugin or workflow, do the comparison in lower (or upper) case, but save the URL in the case that SharePoint recognizes! It will save you a headache!

 

About the Author:

TopLine Strategies delivers the complete integration and development of sales, marketing and customer service technologies that enable corporate clientele to improve revenue streams and strengthen customer interactions. Our project management and consulting is designed to achieve timely delivery, 100 percent user adoption of the technologies we implement and deliver measurable returns on investments for our clients.

Comments (0)

Related Blogs

Whether you’re a user that just wants to share a view with someone or you’re an administrator/manager that would like to create and distribute personalized views, sharing personal views is a very c

Organize Sales and Marketing around the Customer Journey: Gain common purpose, integration and measurable results

The roles that sales and marketing play in an organization and their relationship depend on how company leadership decides to manage and enable cooperation between these two functions.

CRM Tells All

In business, information is power. The better and more complete the information available to your team is, the greater the potential to achieve even greater results.