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