0

I want to update the created by field in sharepoint using sharepoint web services. I tried to do it using List web service's UpdateListItems method but that did not work. Can some one tell me how to do this?

1
  • 3
    Could you show what you've tried? Also, did you use credentials with site collection admin permissions to run the service?
    – Christophe
    May 19, 2014 at 17:45

2 Answers 2

1

If I understand you correctly, you are trying to update created by column of an existing list item in a web service call right? If yes, I am afraid that is not possible. Created by field is a calculated column and can only be entered when a list item is created. Created by column takes the current user context in which the code runs and only when a new item is created.

2
  • In that case, can we update the modified by column using web service.
    – user26955
    May 19, 2014 at 22:29
  • yes, that should be possible, every time you try to update a list item, modified field is updated automatically. Modified field also takes the user security context in which the code runs. So make sure to login or pass credentials of the user you want to see in the modified column. "Editor" is the internal name for modified by column.blogs.msdn.com/b/michael_yeager/archive/2008/11/03/…
    – Ken
    May 19, 2014 at 23:54
0

If you observe the schema of Created By field, it is a read only field. So, in order to update the Created Byfield using web services, you first need to remove read only restriction on it and update the list using UpdateList operation

var removeReadOnly = '<Fields>';
removeReadOnly += '<Method ID="1"><Field  ID="{1df5e554-ec7e-46a6-901d-d85a3881cb18}" ColName="tp_Author" RowOrdinal="0" ReadOnly="FALSE" Type="User" Name="Author" DisplayName="Created By" StorageTZ="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Author" FromBaseType="TRUE" Version="3" ShowInNewForm="FALSE" ShowInEditForm="FALSE" /></Method>';
removeReadOnly += '</Fields>';

See this for more information: http://sharepointnadeem.blogspot.com/2011/08/modifying-created-by-field-in.html

Your Answer

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

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