When i started using Microsoft sharepoint Object Model, We started using SPListItem update method, Sharepoint OM providing the different approach to update the list item. So i decided to brief on the difference between Item Update and SystemUpdate method.
Some important notes on using Update vs SystemUpdate.
For Update: Once you update, the modified by and modified dates change to when the code execute and may show the item as being last modified by logged in user account name. For SystemUpdate(Optional Boolean value)
- Even if you are NOT using Checked out/checked in, the document still has a SPCheckOutStatus.ShortTerm attached to it for a brief period of time. Trying to SPListItem.Update or SPFile.Item.Update at this point will likely tell you that the file is locked for editing. There is a checkoutexpires property to check if you absolutely must wait for the item to be checked back in.
- Even if you do NOT have visioning turned on, you are, in fact, working with a new version of the document. Use SPListItem.SystemUpdate(false) in order to bypass a short term locked document.
You can use SystemUpdate() method whenever you want to retain the created and updated user name. SystemUpdate method does not update the created by and modified by fields and created and modified date also.
Enjoy coding 🙂
- Microsoft Sharepoint updating Author-Created By or Editor field programmatically
- Sharepoint OM, getting email ID from login user name
- SharePoint Developer Interview Questions and Answers
- Microsoft Sharepoint persisting webpart property values
- Client Object Model and Linq to Sharepoint implementation
- List enhancements in SharePoint 2010
- Singleton pattern – Design pattern
- ASP.NET Page Life Cycle explained
- More about SharePoint Custom page and Application Page