Sharepoint itemupdating event

15 Jun

The library was configured with multiple Content Types, but the issue occurred only on some of them.It appeared that for those Content Types, the Managed Metadata field was Optional, not Required.Also not sure why the Event Receivers were missing in the first place.It could be because some “questionable” actions happened during the setup of the site, but it could as well be a bug in Share Point 2010 RTM or later.Every time an item was added to the custom list, the event was firing twice.

The handler simply creates a task in the Tasks list corresponding to the new item added to the custom list.

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.

I’ve written a one-off script (Console App) that loops all lists with a Managed Metadata field on all sites in the site collection and ensures the Taxonomy event receivers. I’m guessing the Optional/Required setting of the Managed Metadata field is involved somehow, but I didn’t really confirm that through testing.

We also had a Power Shell script which was used for bulk updating of documents.

This script was scheduled to run at regular intervals using Windows Task Scheduler.