Sharepoint – add field to content type not updating the list

sharepoint-2010

I am using sharepoint feature upgrade to upgrade my content types and lists.
I have tried both UpdateIncludingSealedAndReadOnly(true) and Update(true) and it is not updating my list with the new fields. The field simply does not appear in the list, although it appears if I go to Site Settings | content Types and open the content type.

Is there anything wrong or perhaps somethign extra that I need to do to push the field to the list?

If I add the field from sharepoint directly (rather than from code) to the content type, it does update the list as well.

Thanks,

Joseph

Best Answer

My experience in these scenarios is that you need to iterate through all usages of your contenttype manually and add your field to each instance of the content type.

Using the SPContentTypeUsage class you can find the instances and loop through them. A colleague of mine has written a good blog post on the subject: http://johanleino.wordpress.com/2009/08/11/propagating-updates-to-content-types/

(I know it's for SP2007, but it applies to 2010 as well.)

Regards, Rikard

Related Topic