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

Modifying the Author field for a programmatically uploaded document

$
0
0

Hi

I have some C# code that I'm using to upload documents to a document library. The code is of the form

doc["Title"]=sTitle;
//doc["Author"]=sAuthor;
doc.Update();
ctx.ExecuteQuery();

So far I've been able to modify various fields correctly, even lookup fields. However if I try to modify the Author field then I just get an exception 'Invalid data has been used to update the list item. The field you are trying to update may be read only.' I have tried using different the User object such as

ctx.Web.EnsureUser(sAuthor);

but nothing works so far.

Any suggestions anyone?

Thanks



Viewing all articles
Browse latest Browse all 25064

Trending Articles



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