Update a List Item Without Updating the Modified Date/Time

I recently had to update a bunch of list items, but I didn’t want to update the modified date field.  I struggled with this briefly before discovering the two update method variations.

This is the first method I was using and this WILL update the modified date field:

// update
i[“CUSTOM_FIELD_NAME”] = itemData.ToString();
i.Update();

 This is the second method and it does NOT update the modified date field:

// update
i[“CUSTOM_FIELD_NAME”] = itemData.ToString();
i.SystemUpdate();

The difference is just .Update() vs .SystemUpdate() with the second updating the database without effecting the date/time fields.  For more info take a look at the Microsoft SPListItem.SystemUpdate Method (Microsoft.SharePoint) page.

Advertisements
This entry was posted in SharePoint and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s