防止从 SharePoint 列表项中删除附件

发布于 2024-08-17 03:26:36 字数 346 浏览 3 评论 0原文

我们有一个自定义 SharePoint 列表类型。我们列表的部分功能取决于每个列表项是否存在特定附件。当用户意外或故意删除列表项的附件(名为DoNotDelete.fi!)时,我们的该项目的功能就会被破坏。因此,我们希望阻止用户删除该特定列表项附件(但应该能够编辑列表项)。

这可以通过使用此列表项的EventReceiver来实现吗?鉴于附件存储在列表的 RootFolder 中,也许 EventReceiver 不需要附加到列表项,而是附加到其他地方?

We have a custom SharePoint list type. Part of our list's functionality depends on the existence of a specific attachment for each list item. When the user accidentally or intentionally deletes the attachment (named DoNotDelete.fi!) of a list item our functionality for that item is broken. Therefore we would like to prevent user from being able to delete that particular list item attachment (but should be able to edit the list item otherwise).

Can this be achieved through the use of an EventReceiver for this list item? Given that the attachments are stored in the RootFolder of the list, maybe the EventReceiver needs to be attached not to the list item but elsewhere?

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

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

发布评论

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

评论(1

何处潇湘 2024-08-24 03:26:36

是的,有可能,我曾经创建过这样的结构。

您必须实现 SPItemEventReceiverItemAttachmentDeleting 方法。
请在此处查看所有可能的方法:http://msdn.microsoft。 com/en-us/library/microsoft.sharepoint.spitemeventreceiver_members.aspx

Yes, it is possible, I have created such a construction once.

You have to implement the ItemAttachmentDeleting method of an SPItemEventReceiver.
See all possible methods here: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver_members.aspx

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