1

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)

0

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

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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