0

I am writing a Webpart for an on-premise SharePoint 2013. I need to persist data to a list with elevated privileges but still need to be able to keep track who changed and added items.

When I view the version history I can only see the System Account, because of of the elevated privileges all changes are done with this account.

Is there a way where I can get a privileged web but still keep the User Information of the actual user?

1

You can update the Modified, Created, Author and Editor with the actual user and time and then call SPListItem.SystemUpdate instead of SPListItem.Update. This way time stamps and actual user information will be preserved.

SPListItem.SystemUpdate Updates the database with changes that are made to the list item without changing the Modified or Modified By fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.