SharePoint 文档库 - 更改“文档创建者"场地 [英] SharePoint Documents Library - Change "Document Created By" field

查看:49
本文介绍了SharePoint 文档库 - 更改“文档创建者"场地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码可以更改各种 SharePoint 列表中的用户名,主要是通过作者"列更改.在普通列表上一切正常,但在文档库共享文档"列表上似乎不起作用.

I have a code that changes the username in various SharePoint lists, mostly by the "Author" column. It all works fine on normal lists, but it doesn't seem to work on the "Shared Documents" list which is a document library.

无论我在创建者"还是文档创建者"中更改用户名,更改似乎都没有生效.item.Update 命令不会引发任何异常,但它显然不会更新字段.

Whether I change the username in "Created By" or "Document Created By", the change doesn't seem to take effect. The item.Update command doesn't throw any exception, but it clearly doesn't update the field(s).

如果我想通过代码改变这个字段怎么办?

What can I do if I want to change this field through code?

谢谢

推荐答案

我找到了解决我的问题的方法.

I found a workaround for my problem.

只有我尝试更新的最后一个字段被覆盖".

Only the last field I'm trying to update is being "overwritten".

因此,虽然以下代码不起作用:

So, while the following code won't work:

item["Author"] = 22;

item.SystemUpdate();

这个就行了:

item["Author"] = 22;

item["Modified By"] = item["Modified By"]; //Or any other field 

item.SystemUpdate();

这篇关于SharePoint 文档库 - 更改“文档创建者"场地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆