Tag Archives: List Item

Maintain SPFile version comment and last modified date when moving documents

In overview the strategy is one of replaying history. Each version of the file is reposted to the document library. The comment and last modified date is handled with a combination of SPFile.Checkin() and SPListItem.Update(). Intrigued? Then read on….

Posted in SharePoint, SharePoint 2007, SharePoint 2010 | Tagged , , | Leave a comment

SharePoint dates

You would like to think that SharePoint records the Creation and Modification dates for each item once only. Wrong! Take a document in a document library. The item is seen as both an SPListItem and an SPFile. The created and … Continue reading

Posted in SharePoint, SharePoint 2007, SharePoint 2010 | Tagged , , | Leave a comment

Content type added to a list does not appear on the New Menu

I’m not sure if others have encountered this behaviour when progammatically adding a content type to a list. In the following code I am adding a content type to a list and ensuring that it appears on the new menu, … Continue reading

Posted in .NET Development, SharePoint, SharePoint 2007, SharePoint 2010 | Tagged , , , , , | Leave a comment

When using the ItemUpdated and ItemAdded events is the only choice you have.

Let me explain by way of an example.  You have implemented a custom insitu EDRMS solution which will set the permissions on an item to ‘Readonly’ when the item’s Item Status column is set to a value of ‘RECORD’.  In making the item … Continue reading

Posted in .NET Development, SharePoint, SharePoint 2007, SharePoint 2010, Tips and Tricks | Tagged , , , , | Leave a comment

Never use SPList.Items.GetItemById(ID)

NEVER EVER use List.Items.GetItemById(ID) or List.Items[ID] Use List.GetItemById(ID) instead. Under normal conditions when there are relatively few items in a list then all will seem to go well.  However, as time goes by and the list item count increases then … Continue reading

Posted in SharePoint | Tagged , , | Leave a comment