SharePoint Integer and Numeric Field (Site Column) Types

One of the Field types available for defining Site Columns is Integer, another is Numeric. When you create a site column using the UI, you won’t see an option for creating a site column of type Integer.

However if you create a site column of type Integer and provision it into SharePoint using a feature, you won’t see it in the Site Columns gallery. Curious, if you then build a Content-Type using this Site Column and provision that into SharePoint, and say, create a list using this Content-Type, voila, at last you will see your “Integer” type Site Column.

It turns out that the base Integer field type is marked UserCreatable = FALSE in the fldtypes.xml file, which mean that you can’t create fields of this type using the UI, but they can still be included as part of a Content Type.

Ok so why might you want to create a field (Site Column) of type Integer. Lets say you want to create a Site Column to store 4 digit years.

e.g.      2009

Well the Numeric field type allows you to set the Decimals part to zero, so the UI won’t display 2009.0. Great, except that the UI will display the year value 2009 as 2,009 with embedded commas,  which as a year display format isn’t great. The Field element also has an attribute called COMMAS which is supposed to control whether to display values using commas.

But, this attribute seems to be ignored, even if you set this attribute to FALSE the value is still displayed using commas.

What to do? enter the Integer field type, it doesn’t suffer from this problem and as long as you only want to use it as part of a Content-Type it’ll work perfectly.

Published by

Phil Harding

SharePoint Consultant, Developer, Father, Husband and Climber.

2 thoughts on “SharePoint Integer and Numeric Field (Site Column) Types

  1. why site column which type=”Integer” disappears in Site Columns gallery? I set type=”Number”, it appears

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.