Friday, April 8, 2011

Handling event when approving a document.

In SharePoint,

using an event receiver, how do we find out when a user has approved a document in a document library?

I would think it should be captured in ItemAdded or ItemAdding event.

Any ideas?

Thanks.

From stackoverflow
  • ItemUpdated is the event receiver to use, unless you want to "override" the approval (and maybe keep the item unapproved) - in this case you should use the ItemUpdating.

    To check if the item is approved you could try this code:

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

    Hope it helps

0 comments:

Post a Comment