SUBSCRIBE to Windows IT Pro Magazine & SAVE 30%     Register today for your FREE 'To The Point' SharePoint eNewsletter
     

     
Skip Navigation Links.
Collapse Office and SharePointOffice and SharePoint
Expand Newsletter ArchivesNewsletter Archives
Expand Office 2007Office 2007
Expand Office 2003Office 2003
Collapse SharePointSharePoint
Expand Installation and DeploymentInstallation and Deployment
SharePoint Extends a Nonprofit’s Reach
How to change your personal information in MOSS 2007
KPI's in Microsoft Office SharePoint Server 2007
Expand Integrating SharePoint and Microsoft Office 2003Integrating SharePoint and Microsoft Office 2003
Diving Into the Windows SharePoint Services 3.0 API
Hide custom list items
Linking to documents in another document library
Custom Web Part Basics
Expand Integrating SharePoint and Microsoft Office 2007Integrating SharePoint and Microsoft Office 2007
Testing Our Web Part Base Class
Expand Working OfflineWorking Offline
Installing Microsoft's Application Templates
Manage quick menu item using EditControlBlock in WSS 3.0
Expand Windows SharePoint Services Document LibrariesWindows SharePoint Services Document Libraries
Creating and Using a New Column Type
Corporate Blogging
SharePoint 2007 Content Types
Windows SharePoint Services Out of the Box
More About SharePoint 2007 Content Types
Using Content Types in Windows SharePoint Services 3.0
SQL storage planning & monitoring (MS white paper)
Display the user name for the logged on user
Outlook 2007 and SharePoint Synchronization
Use Kerberos to Secure MOSS 2007
10 Important Kerberos Facts
Stsadm
SSRS and MOSS 2007
Shared Tasks Lists with SharePoint and Outlook 2007
Introducing the Business Data Catalog
Information Integration: SSRS and MOSS 2007
What Can I Accomplish with Other SharePoint Technologies?
Integrate SharePoint into Your Exchange Environment
Outlook and SharePoint: Playing Well Together
SharePoint Integration with Outlook 2007, Part 3
Bridge the SharePoint File-Restore Gap
Migration Glitch in SharePoint Portal Server
Windows SharePoint Services 3.0 Out of the Box
SharePoint Security Evolution
Creating and Using a New Content Type in SharePoint 2007
Announcements
     

     

     

Creating and Using a New Column Type

Creating and Using a New Column Type

Submitted By: Bob Mixon, MSD2D SharePoint Community Manager and Managing Director of ShareSquared, Inc.
Posted On: 12/4/2006

Over the past weeks, I've been talking about column types and content types in Microsoft Office SharePoint Server 2007, and why you'd want to use them. This week, I'll show you the actual process for creating a new column type, so let's dive right in.

Creating and Using a New Column Type

To get started, you’re going to need a sandbox site to work in, so if you don’t already have one, create it now.

Then, in your new site, go to the Site Actions menu and choose Site Settings.



You'll be taken to the Site Settings page, where you'll see the Site content types and Site column options.

Under the Galleries category, select the Site columns option. You'll be taken to the Site Column Gallery page which contains a list of all the column types defined for the current site and portal. Column types are a site-level resource and are available only at the level where they are defined and lower.

It's recommended that you don't change any of the existing column type definitions in this gallery. Doing so may have a negative impact on your portal. The recommended and best practice approach is to create new custom column types for your specific needs.

At the top of the Site Column Gallery page, you'll see a link labeled Create. (You can probably guess what it's for.) So click it and let’s create our first new column.

The first thing you're prompted to do is give your new column type a name and data type. For demonstration purposes, enter Risk Source as the name and Choice as the data type. The next section allows you to specify how the new column type will be grouped. I prefer to group my custom column types under the name of my company (e.g., ShareSquared Custom Columns). The next section lets you specify additional settings for this new column type. I gave my new column a description, did not make it required, and added two new choices: Design and Planning. After you've completed all the necessary fields, click the OK button and your new column type will be created.

If all went well, you should now be back at the Site Column Gallery page. Scroll down the page until you locate your new Risk Source column type. The left column contains the column type name, the middle column contains the data type, and the right column contains the site for which the column type is defined. As I mentioned earlier, column types are a site-level resource, so where you create it will determine who can access it.

Now let’s put this new column type to use. First, we'll create two custom lists and name them Risks1 and Risks2. In a real world scenario, I wouldn’t have more than one risk list on a project site; however, I'm going to demonstrate what happens when we make a change to the column type definition. So go ahead and create the two lists.

For each of your custom risks lists (Risks1 and Risks2), perform the following steps:

1. Go to Settings, List Settings.
2. In the list schema section, select the Add from existing site columns option. You will be taken to the Add Columns from Site Columns page.
3. Select the group name you gave your column type during the creation process.
4. You should now see your custom Risk Source column type listed. Add it to the Columns to add list.
5. This is optional, but you can add a couple of items to your list. As you will see, the two items (Design and Planning) you added to the Risk Source drop-down menu are now available.

Using the same steps as described earlier, go back to the site Column Gallery (i.e., select Site Actions, Site Settings, then Site columns). Locate your custom column type and click Risk Source. Now update the choices to include Budget. Before you click OK, make sure the Update Lists radio button is set to Yes.

Click OK, then go back and see how the change was propagated to the Risk Source column in both Risks1 and Risks2 Lists.

Now tell me this isn’t a great feature. Think of the hours saved!