Sometimes as a developer we jump into coding before thinking about contextual data availability.One more imprtant thing to notice list event reciever and document libraray event reciever are different interms of contextual data avaialability.Here is the good explanation of the internal mechanisms in Sharepoint taxonomy.Event recievers are common in Sharepoint development so its better to understand the data available in each events. Source: The Item Updating event or the Item Updated event occurs two times when you enable the Require Check Out option for Document Library.Update 2011-11-23: originally this post was written under impression (and it was confirmed by tests) that event receivers are triggered for any custom list which has managed metadata fields.< Elements xmlns=" < Receivers List Template Id="100"> < Receiver> < Name> Schedule List Event Receiver</Name> < Type> Item Added</Type> < Sequence Number>10000</Sequence Number> < Assembly>jeremythake.tvshowschedulesite, Version=126.96.36.199, Culture=neutral, Public Key Token=8eb9a930004f2f1a</Assembly> < Class>jeremythake.tvshowschedulesite. Item Added, "jeremythake.tvshowschedulesite, Version=188.8.131.52, Culture=neutral, Public Key Token=8eb9a930004f2f1a", "jeremythake.tvshowschedulesite.
There appear to be four (4) Taxonomy Event Receivers: The problematic library at the customer was lacking the first set of Event Receivers, which are responsible for syncing the hidden field. I can’t really explain why only some Content Types were affected.
Event Receivers can be attached by either using feature elements definitions or by using the object model (using Feature Receivers). If the vti_sourcecontrolcheckedoutby property exits in the Before Properties property but not in the After Properties property, the event was caused by checking in a document.
The event handler method that are attached are defined in a separate class Event Receiver class that implements either SPWeb Event Receiver, SPList Event Receiver, SPItem Event Receiver or SPEmail Event Receiver. If you want to change a property on the List Item please be aware that you need to use the . Update() within your event receiver you will receive errors such as Save Conflicts. Item Updated, "jeremythake.tvshowschedulesite, Version=184.108.40.206, Culture=neutral, Public Key Token=8eb9a930004f2f1a", "jeremythake.tvshowschedulesite. The following sample code shows you how to do this.
You determine that it’s not the case and you want to inform the user.
So, you set the Error Message property of SPItem Event Properties to the desired text and you set Cancel property to True.