SharePoint 文档库 - 更改“文档创建者”场地
我有一个代码可以更改各种 SharePoint 列表中的用户名,主要是通过“作者”列。它在普通列表上一切正常,但在作为文档库的“共享文档”列表上似乎不起作用。
无论我更改“创建者”还是“文档创建者”中的用户名,更改似乎都没有生效。 item.Update 命令不会引发任何异常,但它显然不会更新字段。
如果我想通过代码改变这个字段怎么办?
谢谢
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.
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?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了解决我的问题的方法。
只有我试图更新的最后一个字段被“覆盖”。
因此,虽然下面的代码不起作用:
但这个可以:
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:
This one will do:
也许这可以帮助 如何更改“Created By”的值...
注意
AllowUnsafeUpdates
属性。Maybe this could help How to change the value of "Created By"...
Pay attention on
AllowUnsafeUpdates
property.