0
如果itemupdated事件在它后面触发,我需要跳过itemadded事件中的代码。有没有共同的解决方案?如何在itemadded事件中检查itemupdated事件是否会在之后触发?
如果itemupdated事件在它后面触发,我需要跳过itemadded事件中的代码。有没有共同的解决方案?如何在itemadded事件中检查itemupdated事件是否会在之后触发?
只需删除itemadded然后。 Itempupdated总是被触发,即使该项目刚创建。所以我不明白你为什么需要ItemAdded。
itemupdated事件不触发每次。它仅在需要检查选项启用时触发。 https://www.simple-talk.com/dotnet/.net-tools/managing-itemupdating-and-itemupdated-events-firing-twice-in-a-sharepoint-item-event-receiver/ – mojo
当我们改变时文件元数据或添加到库后的内容。当我们将文件添加到库时可能会很正确。 – mojo
我找不到如何跳过itemadded事件,但我发现如何检查itemupdate事件是否在itemadded事件之后被写入,因此我可以在itemupdate中撤消对其的更改。有SPItemEventProperties.Versionless属性可以做到这一点。以下是源http://sharepointbulletin.blogspot.com/2013/08/preventing-multiple-events-from.html – mojo