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 am currently facing challenges in distinction between updating an item, and creating a new version of same item. The ItemUpdating eventreceiver is hit in both cases.

Requirements for the library are following...

  • Restricted, so that no metadata chan be changed in the library after creation of an SPListItem
  • Allow a file to be versioned, but without any changes in metadata that are presented to the user.

I am aware of the sequence of events with this setup. They are also mentioned in Damon Armstrong writeup on eventreceivers (Armstrong, 2012). Armstrong addresses the distinction between a check-in and other events...

if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null &&
    properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null)

Are there any simular indicators that chan be checked, when distincting the origin of the ItemUpdating event receiver?


Reference:

Armstrong D., 2012 Managing ItemUpdating and ItemUpdated Events Firing Twice in a SharePoint Item Event Receiver [Online] available from: http://www.simple-talk.com/dotnet/.net-tools/managing-itemupdating-and-itemupdated-events-firing-twice-in-a-sharepoint-item-event-receiver/ (Accessed: 20.NOV.2012)

share|improve this question

1 Answer 1

check if properties.AfterProperties["vti_contenttag"] works for you

share|improve this answer
    
Hi Diptarag. vti_contenttag Shows the value null sometimes - but I cannot see when this is happening –  theodor.johannesen Nov 21 '12 at 10:06

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.