Defining Custom Columns in SharePoint – Field Types and Options
来源:互联网 发布:数据魔方多少钱 编辑:程序博客网 时间:2024/05/22 10:22
Defining Custom Columns in SharePoint – Field Types and Options
A common task for SharePoint developers is defining Site Columns (or Fields) as part of a Feature. When defining a field, you need to assign the field a type. I have created this reference table below to help you map between the the “Create Site Column” SharePoint page to the attributes you would set when defining the field as part of a feature.
Defining Columns using the UICreate Site Column Page
Defining Columns in an Elements file as part of a feature
1: <Field ID="{CCF0A1BF-4823-459c-9773-73890231E070}" 2: Name="ActiveProject"3: DisplayName="Is Project Active"4: Group="Litware"5: Type="Boolean"/>
Type (as shown on the Create Column page)Field TypeNotesMSDN LinksSingle line of textType=”Text” Microsoft.Sharepoint.
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.
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.
Microsoft.Sharepoint.
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.
CurrencyType=”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.
Locale IDsDate and TimeType=”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.
No/False = 0
Yes/True = 1Microsoft.Sharepoint.
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=”
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.
Hyperlink
Format=”Hyperlink”
Picture
Format=”Image”Microsoft.Sharepoint.
Hope this helps you when defining site columns/field.
And one last thing, please remember to also define a group to your organise your fields using the Group=”My Columns” attribute!
0 0
- Defining Custom Columns in SharePoint – Field Types and Options
- Building Custom Field Types in Windows SharePoint Services 3.0
- Custom Sharepoint Lookup Field
- v3 Creating Custom Field Types
- Custom Outcome Options of Task Form in SharePoint Designer on SharePoint 2013 Workflow
- zz - transcript of Defining and Using Shared Resources in a Custom Control Library
- v3 Creating Custom Field Types收藏
- Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer
- [Repost]Custom Elements defining new elements in HTML
- 20060804-Spatial transformations: Defining and applying custom transforms
- Custom level button disabled in Internet Options
- Dive to Liferay Organization Custom Field and logo stored in Database
- Need custom data field in mysql
- How to create your own custom 404 error page and handle redirect in SharePoint 2007 (MOSS)?
- Create custom Task List and Forms in SharePoint 2010 with Visual Studio 2012
- How to create your own custom 404 error page and handle redirect in SharePoint
- android Defining custom attrs
- How to create readonly columns in MOSS 2007 custom list
- 检测网络是否有网络
- cocos2d-x 3.2引擎bug
- RGB(FFFFFF)转255:255:255
- Java菜鸟一月吐槽
- 服务迁到阿里云心得
- Defining Custom Columns in SharePoint – Field Types and Options
- com.alibaba.fastjson.JSONException: error parse e
- Linux网络设备的系统调用
- 海底捞张勇:海底捞的核心竞争力是什么?人力资源体系
- cocos2d-x lua 学习笔记(1) -- 环境搭建
- Linux(Centos )的网络内核参数优化来提高服务器并发处理能力
- 对它的努力表示由衷的感谢
- SSIS 连接Oracle 参数化查询有关问题 (已解决)
- 【算法杂谈_02】树链剖分