Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have an EventReceiver associated to DocLib template id, triggered at every ItemUpdate. Everytime an SPListItem is publish I want to execute my code.

(Required check out and Content approval are turned off)

So, is the type ItemUpdated the best one in this case? What the best way to check if item was publish?

spregards

share|improve this question
    
Why not check properties.ListItem.Level == SPFileLevel.Published? –  Colin Jan 22 at 17:28
add comment

1 Answer

up vote 2 down vote accepted

In ItemUpdated check

properties.ListItem.File.MinorVersion == 0
share|improve this answer
2  
-.- oh god..... –  fallout Apr 3 '12 at 13:42
    
This is Sharepoint :D –  fr34kyn01535 Aug 22 '12 at 6:52
    
@per - am I right in assuming this isn't a way to tell whether the event was fired because it has been published? I need a way of testing the beforeproperties against the afterproperties to monitor changes to whether the document is published or not (i.e. need an event to fire on publishing) but cannot find the appropriate field name. –  DeeMac Dec 10 '12 at 14:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.