批准文档时处理事件

LB.*_*LB. 2 sharepoint event-handling

在SharePoint中

使用事件接收器,我们如何找出用户何时批准文档库中的文档?

我认为它应该在ItemAdded或ItemAdding事件中捕获.

有任何想法吗?

谢谢.

小智 5

ItemUpdated是要使用的事件接收者,除非您想"覆盖"批准(并且可能保持项目未批准) - 在这种情况下,您应该使用ItemUpdating.

要检查项目是否获得批准,您可以尝试以下代码:

public override void ItemUpdated(SPItemEventProperties properties)
{
   if (properties.ListItem["Approval Status"] == "Approved")
   //Do Something
}
Run Code Online (Sandbox Code Playgroud)

希望能帮助到你