忽略共享点列表中未签入条目的更新 (SPAudit)

发布于 2024-09-15 14:41:59 字数 458 浏览 5 评论 0原文

好吧,正如标题所暗示的那样,这有点难以解释。

我在 ItemUpdated 和 ItemCheckedIn 上有一个事件接收器,它们都写入自定义 SPAuditEntries。不过,当 CheckedIn 发生时,它还会附带两个更新条目(一个用于添加的文件,另一个用于对我怀疑的列表项进行简单更新)。

我很想删除这些条目。起初我认为这非常简单,只需在 itemUpdated 事件接收器中放入一个 if ,然后停止一切

if(SPListItem.CheckedOut = false) { //... do nothing }

,但是我找不到任何方法来确定列表项的结账状态。 我的下一个想法是,它们几乎在同一时间命中,因此我可以爬入auditCollection,过滤到特定的列表项、用户和时间(减去一秒)并删除这两个条目。但是,遗憾的是我发现我无法删除审计条目。

有人有什么想法吗?

Okay, this is a little hard to explain, as the title might suggest.

I have an event receiver on ItemUpdated and ItemCheckedIn, which both writes custom SPAuditEntries. When CheckedIn occurs though - it comes with two update entries as well (one for added file, and one for a simple update to the list item I suspect).

I'd love to get rid of these entries. At first I thought it would be really simple, just put an if in the itemUpdated event receiver, and stop everything

if(SPListItem.CheckedOut = false) { //... do nothing }

However I couldn't find any way to ascertain the checkout-status of the listitem.
My next thinking was, they hit almost at exactly the same time, so I could just crawl into the auditCollection, filter down to the specific listitem, user, and time (minus a second) and delete the two entries. But, sadly I found out I couldn't delete auditentries.

Anyone got any ideas?

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

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

发布评论

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

评论(1

笙痞 2024-09-22 14:41:59

签出状态通过以下方式确定:

if (item.Level == SPFileLevel.Checkout) {

其中 itemSPListItem

-Oisin

Checked out status is determined via:

if (item.Level == SPFileLevel.Checkout) {

where item is an SPListItem

-Oisin

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