Tags: , | Categories: Tips and Tricks Posted by BPOS-Tutor on 3/25/2011 6:11 AM | Comments (0)

Situation to Avoid!

You're creating custom columns and content types in SharePoint 2010.  You might want to create the following columns

"Order Status" "Customer Number" "Ship Date" "Part No" "Invoice Number" "PO No"

Seems fairly straight forward right?  Well let me stop you there.  Warning Will Robinson.  Do not pass go. Do not collection $200. 

No Spaces!

What's wrong with a space you ask? Well think about how SharePoint might store your column names in SQL.  SharePoint deals with those spaces by inserting something between them.  For example "Order Status" might become "Order_0x200_Status" and if you had a crawled property it might be "ows_Order_0x200_Status".  When you start dealing with those columns programmatically it gets somewhat tricky to remember what's what. Which column is actually "Order Status". 

Now here's where things get hairy.  I've noticed that when your column values are supplied by Managed Metadata and you start to move documents programmatically through workflow or with the Content Organizer Rules... columns with spaces in their names are treated as second class citizens and your column values get truncated. Eeek. This leads to all types of problems with development and SharePoint search. 

Bottom Line!

If you absolutely, positively need spaces in your column names you should follow this two part naming process. 

1. Create your columns without spaces.

2. Go back and edit your column and change the name to include the space.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList