Events on Adding/Deleting Fields from Content types

One of the things that’s driven me nuts in SharePoint 2007 is that there are no events to capture when a Field is added to a Content Type. There is an OnAdded event – which sometimes gets used to save Custom Properties of the field (though I prefer Gunnar Peipman’s approach)

Well, no more! In SharePoint 2010, there are now OnAddingToContentType() and OnDeletingFromContentType()  methods. We can override this in our custom fields, and this lets us do lots of useful things – like register event handlers, add workflows, or set properties on the content type, which are things that I’ve wanted to do a few times now. So, good news!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>