开发者

Using the Lists web service in SharePoint 2007, how can I update the Author value programatically?

I have a process that uploads a file to a SharePoint form list and would like the Author (Created By) column to be the user who created the file and not the process user. I have been trying the UpdateListItems method of the Lists web service and can update other fields but not the Author field.

Here is a sample of the CAML text I have been trying.

<Batch OnError="Continue" ListVersion="1">
    <Method ID="1" Cmd="Update">
        <Field Name="ID">3396</Field>
        <Field Name="Author"><USERID>;#<USERNAME&g开发者_JAVA技巧t;</Field>
    <Field Name="Created_x0020_By"><DOMAIN>\<USERLOGIN></Field>
    </Method>
</Batch>

Any help or ieda would be greatly appreciated.


You can update Author field after you clear ReadOnly attribute with UpdateList() method. After it you can set Author field by UpdateListItems() method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜