How to redirect a user to a custom page after adding a new List Item

This took me a while to figure out how to do this so I thought I’d share my experience.

Problem:
User needs to perform additional tasks after a new list item has been added to a list. I my case, I wanted the user to create a new list item of information that needed to be emailed to a certain group of people, based on what he/she selected in the new list item form.

Solution:
Create an Event Handler for the list and overriding the ‘ItemAdding’ method to:
(more…)

How to hide a SharePoint list column from a list form (New, Edit, and Display)

Managing the Content Type of a SharePoint List will provide you with the option to Show or Hide a column (aka Field) from the “New.aspx”, “Edit.aspx”, and “Display.aspx” list forms. If you didn’t want to show a column on any of the forms, you could select the column and ‘hide’ it from all forms.

Unfortunately, if you manage the content type of a list form, you are not able to choose which of these forms you can hide a column from. By default, hiding a column will be hidden on all forms.

In this post, I will show you how you can view all columns in your list and then choose which form to hide the column from.

(more…)

When to use SystemUpdate when editing a SharePoint list item programmatically


When coding against the SharePoint object model, I will generally do the following:

  string newFolderName = "My new folder name";
  folder.Item[SPBuiltInFieldId.Title] = newFolderName;
  folder.Item.Update(); // or SystemUpdate(false)

(more…)

Code Snippet: Using the List Field Iterator to display a list form in a SharePoint Web Part

You can use the list field iterator to show the ‘New’, ‘Edit’, and ‘Display’ form in a web part. The List Field Iterator will show all fields in your list view that you specify, and inherits the properties you specify for the view as well (such as column ordering and visible fields).

 
(more…)