Tuesday, March 16, 2010

Updating list items without updating modified date and version

Recently, I came across a requirement where I needed to write a one timer to update data in an existing list.

Well, it is not difficult to do so as we know that SharePoint Object Model is out our rescue. But the point is, the data needed to be updated without creating new versions and also without updating modified date for each item in the list.

Where there is a will, there is a solution. Here is the magic code that did the trick. After receiving the reference to the list item, just before updating the item using Update() method, code as under.


NOTE: Please note that listiteminstance.Update(); should not be called again, else modified date will be updated.

No comments:

Post a Comment