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:
- Microsoft Sharepoint SystemUpdate and Update using object model
- SharePoint Developer Interview Questions and Answers
- Sharepoint OM, getting email ID from login user name
- Client Object Model and Linq to Sharepoint implementation
- List enhancements in SharePoint 2010
- More about SharePoint Custom page and Application Page
- Creating the custom theme in MOSS Branding
- There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined
- Sharepoint 2010 features
- SharePoint 2010 migration tips