Home > ContentType, General, SharePoint 2007, SharePoint2010 > SharePoint 2010/2007 Custom Site Column – Field Type and Options

SharePoint 2010/2007 Custom Site Column – Field Type and Options


Type (as shown on the Create Column page)

Field Type

Notes

MSDN Links

Single line of text

Type=”Text”

   

Microsoft.Sharepoint.SPFieldText

Multiple lines of text

Type=”Note”

In the Create Column page, can pick the type of text to allow. To enable the different sub-types, you need to set a couple of other attributes on the field element.

Plain Text
RichText=”FALSE”  (default value)

Rich Text
RichText=”TRUE”
RichTextMode=”Compatible”  (default value)

Enhanced Text
RichText=”TRUE”
RichTextMode=”FullHtml”

In addition, you can also set the number of lines to display using the NumLine attribute.

Further Information on MSDN:

Microsoft.Sharepoint.SPFieldMultiLineText

Choice (menu to choose from)

Single Choice
Type=”Choice”

Multi-Choice
Type=”MultiChoice”

Pick the display format for the Choice and Multi-Choice types, respectively:

Drop-Down Menu or Combo Box
Format=”Dropdowns”

Radio Buttons or Check Boxes
Format=”RadioButtons”

Define the options a user can pick from using the Choices element. Below is a skeleton to explain this.

<Field Name=”MyOptions” Type=……>
  <CHOICES>
     <CHOICE>Option 1</CHOICE>
     <CHOICE>Option 2</CHOICE>
  </CHOICES>
</Field>

If you would like to give the user an option to add their own value, set the attribute FillInChoice=”TRUE”.

Microsoft.Sharepoint.SPFieldChoice
Microsoft.Sharepoint.SPFieldMultiChoice

Number

Type=”Integer”

This field type also lets you define:

Minimum Value (0 for example)
Min=”0″

Maximum Value (100 for example)
Max=”100″

Decimal Places (Default is Automatic, example 2 decimal places)
Decimals=”2″

Show as Percentage (Default is False)
Percentage=”FALSE”

Microsoft.SharePoint.SPFieldNumber

Currency

Type=”Currency”

This field type also lets you define:

Minimum Value (0 for example)
Min=”0″

Maximum Value (100 for example)
Max=”100″

Decimal Places (Default is Automatic, example 2 decimal places)
Decimals=”2″

Currency Format
This sets the display format of the currency.

LCID=”3081″

3081 sets the format English – Australian. For a complete list of Locales, see the MSDN link in the next column.

Microsoft.Sharepoint.SPFieldCurrency

Locale IDs

Date and Time

Type=”DateTime”

This field also lets you define:

Date and Time Format
Show the date only:
Format=”DateOnly”

Show the date and time:
Format=”DateTime”

Microsoft.Sharepoint.SPFieldDateTime

Yes/No

Type=”Boolean”

When setting the default value, you need to use the binary values:

No/False = 0
Yes/True = 1

Microsoft.Sharepoint.SPFieldBoolean

Person or Group

Single User or Group
Type=”User”

Multiple Users or Groups
Type=”MultiUser”

This field also lets you define:

Allow multiple selections
Set the Type to MultUser and the attribute Mult=”TRUE”

Allow selection of
People Only
UserSelectionMode=”PeopleOnly”

People and Groups
UserSelectionMode=”PeopleAndGroups”

Choose from
If you want to limit the option list to a SharePoint Group, use the UserSelectionScope attribute. Set it to the ID of the SharePoint group (Integer value). For example, UserSelectionScope=”3″.

Show field
Set the name of the field from the User’s profile properties that you want to display. For example, show the user’s name property:
ShowField=”Name”

If you would also like to show presence (Office Communicator integration required):
Presence=”TRUE”

Microsoft.Sharepoint.SPFieldUser

Hyperlink or Picture

Type=”URL”

You can display the URL as a Hyperlink or Picture. Use the Format attribute to pick which one:

Hyperlink
Format=”Hyperlink”

Picture
Format=”Image”

Microsoft.Sharepoint.SPFieldUrl

 
 

  1. Marie Kristin Johansen
    15.09.2010 at 08:20 | #1

    Hi,

    Thanks for a great overview!

    Just wanted to let you know that the type for a user field witch allows for multiple selections is not of type MultiUser but UserMulti (at least in 2010). Using the wrong field types caused me alot of extra work so it would be great if you updated it:)

    Marie

  2. 12.01.2011 at 10:52 | #2

    You have mistakes in type of User field.
    Is possible set: User or UserMulti (not MultiUser)

  1. No trackbacks yet.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 41 other followers