2

I am uploading documents to Document Library using copy web service. I need to update read only fields like created, created by, modified, modified by, version,.. I changed the read only property of those fields to false and updated the values, but i can't update for created by and modified by fields. How to do this?

Also i used DWS web service to create new folder in Document Library. Here also i need to update those values. How to achieve this. Is there any similar property like Field Information in DWS web service??

3
  • could you add your code so we can see what might be the problem? Commented May 13, 2013 at 5:43
  • FieldInformation i1 = new FieldInformation { DisplayName = "Created By", InternalName = "Author", Type = FieldType.User, Value = "userid;#username" }; I am getting no error and content also not updated. Created By field is updated with credential that i used for this web service and not with new user i mentioned here.
    – Suren
    Commented May 13, 2013 at 5:57
  • It might be easier to edit your question to include the code (formatted) rather than add using a comment.
    – SPDoctor
    Commented Jun 24, 2013 at 14:51

1 Answer 1

1

Following code snippet could help you.

// add the file  
SPFile file = docLib.RootFolder.Files.Add(newFileName, inputStream);  
// get the list item for that file  
SPItem item = file.Item;  
//Set the Created Date
item["Created"] = "2009-02-26 15:00:00";
item.Update();
1
  • I am using only web service. I can't use any SharePoint objects here.
    – Suren
    Commented May 13, 2013 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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