Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Are SPListItem["Author"] and SPListItem["Editor"] fields read only in SharePoint 2013SP1?

$
0
0

Hi all,

I want to set the SPListItem item["Editor"] in SharePoint 2013SP1 to the true CurrentUser when item["Editor"] is set to “System Account” at two occasions:

1 When doing a rename of a document under SPSecurity.RunWithElevatedPrivileges the ”Modified By” user is ”System Account”.

The only solution I have been able to function is to after renaming the document, in the normal user context do a file check out, file check in and then an item.Updateoverwrite() version (which regardless of it's name and documentation do create a new version…). But the ”Modified By” user is at least correct after that update.

2 A 2010 Workflow approval end with that the ”Modified By” user is set to ”System Account”. Every effort I have done has failed to set ”Modified By” user to the true CurrentUser without incrementing the version (and hence not an approved document any more).In a referenceabout SPListItem it says that it is possible to setitem["Editor"] under elevated security. But when ItemUpdated is running under”System Account” during an Approval,setting the item["Editor"]failed for me.

A third occasion is that when the user want to edit a document, in ItemCheckout, I want to set the SPListItem["Author"]to the true CurrentUser.

I have spend a number of hours trying to update SPListItem["Author"] and SPListItem item["Editor"] in SharePoint 2013SP1 as described. I have found many examples on Internet but implementing them have all failed without success with more or less strange error messages.

So are SPListItem["Author"] and SPListItem["Editor"] fields read only now in SharePoint 2013SP1 without proper error messages? The SPBuiltinfieldid members are read only, see Microsoft on line reference.

(This site denies me the right to insert references, so I can't give them)

Best Regards

Csaba Urbaniczky



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>