June 2012 blog post update:
I’ve received quite a few SharePoint 2010 questions regarding this solution, so I’ve added SP2010 setup instructions. For you MOSS 2007 users, don’t worry! The old MOSS setup instructions are still included at the tail end of the post.
When I was at the Best Practices Conference in La Jolla a couple of weeks ago, I taught a session on successfully deploying SharePoint lists. While we looked at a wide variety of tips and tricks and list implementation examples, the attendees were really intrigued by a content type solution I’d implemented to quickly/easily modify NewForm and EditForm ASPX pages. I promised them a blog post on the solution–here it is.
Business scenario:
We use a SharePoint list to store help desk support requests. All SharePoint users have the ability to go to this list and add their support request as a new item. Once they submit their request, the support reps take over ownership of the list item. The support reps have additional information they want to log for each support request (e.g. support rep assigned to the issue, issue resolution, etc.). In order to accommodate, we need to add some “for office use only” fields to our list.
So what are our basic requirements for this solution? We need a streamlined NewForm.aspx page that asks users basic questions about their support request. Once a new item is submitted, we need the item’s EditForm.aspx page to contain additional data fields for the support reps.
Solution:
I could modify my OOB NewForm.aspx and EditForm.aspx pages to achieve these results. This is quite a bit of work, though. Since I want my support reps to be able to manage the fields that display on the NewForm and EditForm pages on an ongoing basis, I’d like a simpler approach that can be managed entirely via the SharePoint web interface. The solution? CONTENT TYPES!
Here’s the basic building blocks of this solution:
- Setup of 2 new content types (one named “New item” and another named “Existing item”)
- Setup of a simple SharePoint Designer workflow
We’ll apply 2 content types to my list. We’ll set up “New item” as the default content type that is automatically used when a user clicks on the New button. Next, we’ll set up a SharePoint Designer workflow. This workflow will fire whenever a new item is created in my list. The workflow has a single step with a single action–change the Content Type field from “New item” to “Existing item.” That’s it. When a user creates a new item, the “New item” content type will display a shortened set of fields. As soon as this item is saved, our SharePoint Designer workflow will convert the content type to “Existing item” and the resulting “Existing item” content type fields will display.
Here’s the nitty gritty on how to set this up in SharePoint 2010:
Part 1: Create your new content types.
- Click on Site Actions > Site Settings.
- Under Galleries, click on Site content types.

- Click on the Create button.
- In the Name field, type New item.
- In the Select parent content type from field, select List Content Types.
- In the Parent content type field, select Announcement. Your page should now look like this:

- Click OK.
- You will be taken to a configuration page for your new content type. Click on the Body field. When the field detail page opens, click Remove. Say OK when you’re prompted to confirm your deletion.
- Click on the Expires field. When the field detail page opens, click Remove. Click OK to confirm your deletion.
- Click on the Site Settings link in your page’s breadcrumb to return to the main site settings page.
- Repeat steps 2-9, this time creating an “Existing item” content type.
Part 2: Add your new content types to your list.
- Go to your SharePoint list.
- Click on the List subtab and the List Settings icon.

- Click on Advanced Settings and set the Allow management of content types field to Yes.
- Click OK.
- Go to the Content Types section of the page and click on the Add from existing site content types link.

- Scroll throught the list of available content types until you find the New item content type you just created. Click on New item and then click on the Add button to move it over to the selection box.
- Find and click on Existing item. Click on the Add button to move it over to the selection box.
- Click OK. You are now returned to the main list settings page.
- Go to the Content Types section of the page and click on the Change new button order and default content type hyperlink.
- Uncheck the checkbox for the Item content type and click OK.

Part 3: Configure your content types to display desired fields.
- You should still be on your list settings page. Go to the Content Types section and click on your “New item” content type.
- Click on the Add from existing site or list columns hyperlink. Add the fields you want to display on your “custom” NewForm.aspx page.
- Use the Column order link to define the order in which your fields display.
- Click on the List Settings link in your page’s breadcrumb to return to the list settings page.
- Repeat steps 1-4 for the “Existing item” content type.
Part 4: Turn “management of content types” off.
Since we don’t want users to see the Content Type field when they are creating or editing list items, we want to turn off the “management of content types” option. Turning this off doesn’t prevent the content types from running–it just prevents the unwanted Content Type field from displaying.
- Go to your List Settings page.
- Click on Advanced Settings.
- Set the Allow management of content types field to No.
- Click OK.
Part 5: Create your SharePoint Designer workflow.
This is the last part of this solution. This workflow will automatically detect that a new item has been created and subsequently convert the new item to the existing item content type. Once this is done, the “for office use only” fields will display for the list item.
- Open your site in SharePoint Designer.
- While on your Site tab, click on the List Workflow dropdown arrow and select your SharePoint list.

- When the following dialog box appears, specify a name and (if desired) a description for your new workflow.

- Click OK to save your changes.
- The workflow builder page will display. Click on the Action button in your ribbon. Then scroll down to the List Actions section and select Set Field in Current Item.

- Your workflow will now look like this:

- Click on the field hyperlink and select Content Type ID.
- Click on the value hyperlink and select Existing item.
- Now click on the Workflow Settings button in your toolbar ribbon.
- In the Start Options box, check the Start workflow automatically when an item is created option. Next, make sure all other Start Options are unchecked.

- Click on the Publish button in your toolbar ribbon to save and publish your new workflow.

That’s it. Now when users create a new item in your list, your SharePoint Designer workflow will automatically reset the new item’s Content Type field from New item to Existing item. This will cause the edit item screen to display a different set of fields for all your existing list items.
Here is our customized NewForm.aspx page:

Here is our customized EditForm.aspx page:

For you MOSS 2007 users, here’s the nitty gritty for setup in 2007:
Part 1: Create your new content types.
- Click on Site Actions > Site Settings.
- Under Galleries, click on Site content types.
- Click on the Create button.
- In the Name field, type New item.
- In the Select parent content type from field, select List Content Types.
- In the Parent content type field, select Announcement.

- Click OK.
- You will be taken to a configuration page for your new content type. Click on the Body field. When the field detail page opens, click Remove. Say OK when you’re prompted to confirm your deletion.
- Click on the Expires field. When the field detail page opens, click Remove. Click OK to confirm your deletion.
- Click on the Site Content Type Gallery link in your page’s breadcrumb to return to the main site content type gallery page.
- Repeat steps 3-9, this time creating an “Existing item” content type.
Part 2: Add your new content types to your list.
- Go to your SharePoint list and click Settings > List Settings.
- Click on Advanced Settings and set the Allow management of content types field to Yes.
- Click OK.
- Go to the Content Types section of the page and click on the Add from existing site content types link.
- Find and click on New item. Click on the Add button to move it over to the selection box.
- Find and click on Existing item. Click on the Add button to move it over to the selection box.
- Click OK. You are now returned to the main list settings page.
- Go to the Content Types section of the page and click on the Change new button order and default content type hyperlink.
- Change the content type order so your “New item” content type is number 1.
- Click OK.
Part 3: Configure your content types to display desired fields.
- You should still be on your list settings page. Go to the Content Types section and click on your “New item” content type.
- Click on the Add from existing site or list columns hyperlink. Add the fields you want to display on your “custom” NewForm.aspx page.
- Use the Column order link to define the order in which your fields display.
- Click on the Settings link in your page’s breadcrumb to return to the list settings page.
- Repeat steps 1-4 for the “Existing item” content type.
Part 4: Turn “management of content types” off.
Since we don’t want users to see the Content Type field when they are creating or editing list items, we want to turn off the “management of content types” option. Turning this off doesn’t impact the content type display of fields–it just prevents the unwanted Content Type field from displaying.
- Go to your list’s settings page.
- Click on Advanced Settings.
- Set the Allow management of content types field to No.
- Click OK.
Part 5: Create your SharePoint Designer workflow.
This is the last part of this solution. This workflow will automatically detect that a new item has been created and subsequently convert the new item to the existing item content type. Once this is done, the “for office use only” fields will display for the list item.
- Open your site in SharePoint Designer.
- Click on File > New > Workflow.
- Specify a name for your new workflow (e.g. “Content type conversion”).
- Select your list in the provided dropdown field.
- Check the box labeled Automatically start this workflow when a new item is created. Make sure the other 2 checkboxes are not checked.
- Click on the Next button.
- Click on the Actions button and select Set Field in Current Item.
- Click on the field hyperlink and select Content Type.
- Click on the value hyperlink and select Existing item.
- Click on the Finish button.

That’s it. While this looks like a large number of steps, it only takes about 5 minutes to set up. If you want to re-use this solution multiple times in your site collection, set up your “New item” and “Existing item” content types in your site collection’s content type gallery. This ensures that these content types are available for use in all of the sites within your site collection.
Here is our customized NewForm.aspx page:

Here is our customized EditForm.aspx page:
