Why prefer this method?
I just attempted to update a content type I created in a list definition via CAML and had no issues doing it. What is the reasoning behind this best practice?
|
Why prefer this method? I just attempted to update a content type I created in a list definition via CAML and had no issues doing it. What is the reasoning behind this best practice? |
|||
|
|
|
Did you try changing the type of a field in your change? Also, is the content type used in multiple list definitons/list templates? It might have worked for your case, but if you update it via the event receiver you have full control over what's happening, how you want your lists to adapt to your changes, how you want to convert values in case you change column types, etc. |
|||||||
|
|
Feature receiver updates are very useful when you change the version of the assemblies you are deploying, say from v1.0 to v2.0 - When you upgrade that is what you do right? When you upgrade from v1.0 to v2.0, you might want to do specific things (like creating new lists or modifying site permissions etc.,) which can be accomplished by event receivers (object model). And you can use CAML to update Content Types where you may want to add just an extra column and push changes to all the lists and libraries which SharePoint will do it for you automatically. With versions, your change, whether it is just adding a coloum to the content type or complex change using object model, it is recorded. |
|||
|