gpt4 book ai didi

Sharepoint 事件处理.. 更改了哪一列?

转载 作者:行者123 更新时间:2023-12-03 10:01:27 25 4
gpt4 key购买 nike

我正在编写一个事件处理程序来处理列表中特定 SPItem 的更新。该事件是异步的,我可以毫无问题地获得 SPEvenItemProperties。我想知道的是 SPItems 列中的哪一个真正触发了事件。任何人都知道如何?

提前致谢。

最佳答案

您的答案在一定程度上取决于检索 SPListItem 的位置和方式。在常规列表中,您无权访问项目的先前值。如果你打开版本控制,你当然可以访问以前的版本,这取决于权限。

对于文档库,您可以使用 SPItemEventProperties.BeforeProperties 获取文档的先前元数据。

对于文档库,您可以尝试这样的操作:

foreach (DictionaryEntry key in properties.BeforeProperties)
{
string beforeKey = (string)key.Key;
string beforeValue = key.Value.ToString();

string afterValue = "";
if (properties.AfterProperties[beforeKey] != null)
{
afterValue = properties.AfterProperties[beforeKey].ToString();
if (afterValue != beforeValue)
{
// Changed...
}
}
}

.b

关于Sharepoint 事件处理.. 更改了哪一列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1376534/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com