SharePoint Required Site Columns are a Jerk!

The problem:

You have a content type template saved on the server and tied to the content type.  The content type has required fields.  To leave the fields blank, you have to change the content type fields to “optional” in order to make updates to the template.  When you have a huge site collection with tons of document libraries consuming this content type, it can take a really long time to propagate the change, or it might not work at all in some circumstances.  (It errors out on us a lot)  In short, it’s evil.

The solution:

This is a pretty bad workaround, but it’s what we got.  I’ve heard talk of creating duplicate content types which have the same fields but they aren’t required, but no one seems to know how to get those templates then saved back to the right content type without them being “checked out with no checked-in version” and I couldn’t get it to work.  We created a set of “template” specific values for the fields.  When a new document is created, these values are what gets filled in by default.  Depending on how many you have, you may be able to use column validation to keep them from getting saved to your document libraries.  If one of your required is a date field, I recommend putting a date into the template which you can easily search for – we chose 5/25/1977.  10 points to anyone who knows the significance!

Here are some examples of what we use:

Project Name: Template
Sign-off Status: Template
Sign-off Version: 0
Sign-off Date: 5/25/1977

See where we are going with on this?  This helps you quickly identify which items need to be chanced, or you can set up column validation so that no one can save them wrongly on the server in the first place.

So, I hope this sad solution helps someone out.  We use a script to dump the metadata into a csv file so we can find anyone who saves documents with the template data in them.  Some day maybe I’ll write a post on how to query that csv, because it’s not easy or fun.  I lied, it is fun.  I’m such a nerd!

Advertisements

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 )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s