SharePoint Experts, Information Architects, Expert Witness

We provide consulting in a broad array of business and technology from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. Specialists in Microsoft, we are a premier provider of SharePoint Expertise (including 2016 and Office 365). We also provide Expert Witness/Legal Expert in eDiscovery, source discovery, patent infringement, piracy and more! We also have established SICG DLDS s.a. - our counterpart in Costa Rica that specializes in water systems (http://www.crwatersolutions.com) - Contact me direct: david_sterling@sterling-consulting.com or call 704-873-8846 x704.

Search This Blog

Friday, March 17, 2017

Content Types and Hidden Columns not available in List/Library

Came across a reminder the other day about using Content Types with Hidden Columns. As you may know, Hidden Columns do not show up in forms allowing you to use them for values that might be generated by a Workflow or similar.

In my case, I created a workflow that needs to set a 'Document Number', something other than just using ID, this one uses a list to keep track of the latest number. As a good practice, the definitions were setup as Content Types (in my case, 3 - 1 core and 2 that inherit from the core).

The need here is that a) the Document Number needs to be assigned by the workflow, b) visible in the List/Library Views and c) it isn't supposed to show up when adding/editing an item (i.e. so user cannot change).

So, one might think to simply set the field/column to Hidden up front and here's where the problem comes in.

If you set a column as Hidden, it does indeed appear in the content type but when the content type is added to a list/library, surprise! The column is not added, thus not available in the views - defeating the entire purpose.

The solution is a sloppy workaround but does work (you just need to document this!).

BEFORE adding the content type to the list/library, leave the field as Optional - this includes any content types that inherit from it.

NEXT add the content type(s) to the list/library - the column will appear. Set any views that you want, particularly those that need to display the column.

AFTERWARDS, go back to the Content Type(s) and set the column as hidden.

Once this is done, you will be able to use the column as you would have expected in the first place.

This problem has be a long standing one (past 4 years or more).

An extensive post on this (from back in 2013!):

https://paylord.wordpress.com/2013/11/18/content-types-and-hidden-columns/