SharePoint - 检查事件接收器中的内容批准更改状态 [英] SharePoint - checking Content Approval change status in event receiver
问题描述
我有一个启用了内容批准的 SharePoint 列表.业务要求是,一旦新列表项获得批准,尽管任何用户进行了进一步更新,它仍应保持批准状态.
I have a SharePoint list with Content Approval enabled. The business requirement is that once the new list item is approved it should stay approved despite further updates by any user.
我首先想到的是处理ItemUpdating方法,如果对应的before属性为Approved,则将after属性设置为Approved.但是这不起作用.
My first thought was to handle the ItemUpdating method, and if the corresponding before property is Approved then set the after property to Approved. This doesn't work however.
在 ItemUpdating 方法中,批准状态"列不会显示在 properties.BeforeProperties 或 properties.AfterProperties 中.properties.ListItem["Approval Status"] 和 properties.ListItem.ModerationInformation.Status 都显示之前"值.在 ItemUpdated 方法中,情况是相同的,只是显示的值是之后"值.
In the ItemUpdating method the "Approval Status" column does not show up in properties.BeforeProperties or properties.AfterProperties. properties.ListItem["Approval Status"] and properties.ListItem.ModerationInformation.Status both show the "before" value. In the ItemUpdated method the situation is the same, except instead the values shown are the "after" values.
这两种方法有没有办法同时识别方法之前和之后?我可以通过创建一个新的隐藏列来解决这个问题,我在项目获得批准时设置该列,但这似乎不是最好的.
Is there a way in either method to identify both the before and after methods? I can work around this by creating a new hidden column that I set when the item is approved but that doesn't seem best.
我应该从工作流的角度来解决这个问题吗?
Should I be approaching this from a workflow perspective?
推荐答案
这有帮助吗?
http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=25
这篇关于SharePoint - 检查事件接收器中的内容批准更改状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!