Skip to main content

Cloud

Default Values – Site Columns in Content Types

I recently ran into an interesting SharePoint problem on a client project. I had a publishing page content type that used multiple site columns and some of these columns had default column values, but when I used my content type to create pages, SharePoint didn’t select any of the default values. Obviously, my first debugging step was to check my site column definitions and my content type definition, but I didn’t find any issues with my schema.

COLUMN DEFINITION
<Field ID="{guid}"
Group="My Site Columns"
Name ="SiteColumnName"
StaticName="SiteColumnName"
DisplayName="Site Column Name"
Type="MultiChoice" Required="TRUE">
<CHOICES>
<CHOICE>Best</CHOICE>
<CHOICE>Better</CHOICE>
<CHOICE>Good</CHOICE>
</CHOICES>
<Default>Best</Default>
</Field>

COLUMN REFERENCE IN CONTENT TYPE
<FieldRef ID="{guid}" Name="SiteColumnName" Required="TRUE" />

Apparently, the content type has to be set as the default content type on a list/library or SharePoint will completely ignore the default values. So next time, when you run into a similar issue, make sure to mark your content type as the default content type on your list.

HTH,
Talha

Ref: http://sweechingho.blogspot.com/2008/07/sharepoint-site-column-default-value.html

Leave a Reply

Your email address will not be published. Required fields are marked *

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