When creating a new List or Library in SharePoint, or even creating a new Folder inside the list or library, the URL generated by SharePoint may not match the name entered by the user.
I need to programmatically construct the same URL as SharePoint from the same data a user might manually copy and paste into the Create dialog's textboxes, but I don't know the algorithm it uses.
I'm using K2 Studio to create workflows that integrate with SharePoint 2010. Management strongly prefers a no-code solution, but I do have access to Visual Studio and am willing to use it. With the hassles of connecting to a claims-authentication environment, I'd prefer any .Net code use K2's built-in features or not connect to SharePoint.
Example of problem:
Incoming data which a K2 Blackpearl workflow uses to create a new library:
abc-123 (firstname.lastname@example.org). If that data is pasted into name field of SharePoint's "Create" dialog when creating a new list or library, many of the characters will be dropped from the resulting URL. The URL will probably end up like this:
...\abc123%20defghi.jkl. Similar (or even identical) logic is applied when a K2 Blackpearl workflow creates a new list or library in SharePoint.
I have not found any documentation for what characters are kept, which are dropped, and which get URL encoded. Without that knowledge, I cannot ensure that the URLs I attempt to construct from the same data used to construct the library names will actually match the URLs created by SharePoint.
If the generated URL matches an existing URL, what does SharePoint do? Throw an error, append a counter? Something else?