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 https://cmsstores.com/microsoft-sharepoint-systemupdate-and-update-using-object-model/

Enjoy coding 🙂
Sandesh

Similar Topics: