Add this to the list of things every SharePoint developer should know (up there with disposing SPWebs and SPSites).

In general…

  1. Don’t update SharePoint objects on a GET request
  2. Call SPUtility.ValidateFormDigest() before anything on a POST request

Here are the two links to read:

Two identical custom lists with the same columns. The only difference is that one list has columns added using Site Columns and the other list had columns added directly to the list. The same? Not so much…
» Read more…

My problem started with a simple change to a site column. I had originally created a Country field with the following values:

  • US
  • Canada

After a change in requirements, the new values for the field were:

  • Canada
  • Germany
  • Great Britain
  • Ireland
  • United States

After updating the site column, I then needed to update the hundreds of items in the list to use “United States” instead of “US”. Instead of updating hundreds of items manually, I decided to write a small web services console app. (I was also not able to update it in datasheet… due to content approval maybe???)

However, I quickly ran into problems when attempting to update the multi-select choice field.

» Read more…

The SPGridView is one of the most useful SharePoint controls. You can use it to do sorting, grouping, and filtering just like the out of the box List View Web Part does for regular lists and libraries. This makes it relatively easy to create a custom grid with your own data. Unfortunately, filtering with the SPGridView is a little quirky, especially if your data could potentially contain apostrophes.

» Read more…

The most recent problem I ran into was when I tried to filter out items that had a  certain Workflow status in the list. More specifically, I was trying to filter on items that had errored out and had a status of “Error Occurred” in the list.
» Read more…