Sharepoint List ItemDeleting 事件何时实际触发?

发布于 2024-09-11 18:00:39 字数 561 浏览 3 评论 0原文

我们希望基于某些自定义功能来阻止删除列表中的文档。

我们尝试的是在 ItemDeleting 事件中实现这一点。当我们不希望用户能够删除文档时,我们将 SPItemEventProperties 的 cancel 属性设置为 true。

发生的情况是,当不允许用户删除文档时,下拉菜单中的“删除”选项消失了。在某种程度上,这是可行的,但该事件是在用户实际尝试删除文档之前触发的。

给我们带来问题的是,如果用户通过 MS Word 2003 连接到文档库,则可以删除文档。在这种情况下,ItemDeleting 事件似乎不会触发。

有没有一种方法可以让我们在通过 MS Word 删除文档时触发事件并回滚删除操作。

编辑

部分问题可能是事件不会在资源管理器视图中触发。这个“bug”有解决办法吗?

We would like to block the deletion of documents in a list based on some custom functionality.

What we have tried is to implement this in the ItemDeleting event. Where we set the cancel property of SPItemEventProperties to true when we do not want the user to be able to delete a document.

What happened was that the Delete option in the dropdown menu disapeared when the user was not allowed to delete a document. In a way this works, but the event is firing before the user actually tries to delete the document.

What is giving us problems is that the user can delete a document if they connect to the document library via MS Word 2003. In that case it does not appear that the ItemDeleting event fires.

Is there a way that we can get an event to fire and rollback the deletion when the document is deleted via MS Word.

Edit

Part of the problem could be that events do not fire in explorer view. Is there a fix for this "bug"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一口甜 2024-09-18 18:00:39

ItemDeleting - 在删除项目之前触发的事件。

更多内容请点击此处

ItemDeleting - An event that fires before an item is deleted.

more click here

浪荡不羁 2024-09-18 18:00:39

我现在没有 sharepoint 开发环境,所以我无法给出确切的答案,但您可以检查一件事,即当用户对 MS Word 2003 中的文档执行任何操作时,会触发 ItemUpdating 事件。您可以探索 ItemUpdating 事件以查看文档将发生什么,然后进行相应的处理。

I do not have sharepoint development environment right now so I can not give the exact answer but you can check on one thing that when user performs any action on a document from MS Word 2003 ItemUpdating event is fired. You can explore ItemUpdating event to see what is going to happen with the document and then deal with it accordingly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文