Maintain SPFile version comment and last modified date when moving documents

It is difficult to maintain the version comment and last modified date when moving or copying a document with its version history. This metadata is normally only writable at the time the document is checked in. So if a document is moved from one location to another Continue reading

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 modified dates are recorded separately for each. The actual item data is recorded in two SQL tables. Continue reading

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

Claims-based authentication and user profiles

Turns out it is relatively trivial to create a user profile for a claims authenticated user. You are probably familiar with the UserProfileManager.CreateUserProfile method. The overload of interest takes a string parameter that is the username of the profile to create – the signature is as follows Continue reading

Posted in SharePoint 2010 | Tagged , | Leave a comment

Redirect relative to the SharePoint LAYOUTS directory

If you ever need to redirect to a page that resides in the /_layouts/ virtual directory, i.e. the physical directory found in the SharePoint root in {SharePoint Root}\TEMPLATE\LAYOUTS it is possible to do so without hard coding the URL. Use the SPUtility.Redirect method. Continue reading

Posted in SharePoint, SharePoint 2007, SharePoint 2010, Tips and Tricks | Leave a comment

GetAssociationByBaseId returns null when the workflow association is disabled

This in my opinion is a bug but feel free to disagree.
I came across this odditty when checking that workflow associations were enabled before attempting to start the workflow programmatically. Continue reading

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