Microsoft Sharepoint updating Author-Created By or Editor field programmatically

When i started working with sharepoint event receiver, i have a requirement to update the sharepoint list’s author and editor value. I have tried googling but I’m not able to find good resource on this. So i have decided to share the code snippet to update the author and editor using sharepoint object model.

If you want to update the list’s field value without updating the the created by and modified by user and date you can use the below code.

SPListItem item = list.Items.Add();
item[“Title”] = “Something”;
item.SystemUpdate(false);

If you want to update the created by and modified by user then you can use item.Update() method, It will update the created and modified user with current login user.

If you want to know more about Update and system update you can check my post http://cmsstores.com/microsoft-sharepoint-systemupdate-and-update-using-object-model/

Enjoy coding 🙂
Sandesh

Similar Topics:

We will send you more information on Microsoft Sharepoint updating Author-Created By or Editor field programmatically.
Enter your email address:
This entry was posted in Sharepoint and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *