Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Adding columns to existing content types - updating lists

  Asked By: Sonya    Date: May 04    Category: Sharepoint    Views: 4604

I always deploy site columns and content types through xml definitions in features. Sometimes I need to update the content types by adding a new column. This I did recently, I added a column with a new <FieldRef-tag in my content type xml and upgraded my solution. I then inactivated and activated my feature and my content type looked fine.

But I had problems with a pages list in a subweb that had several pages based on that content type. When I tried to edit them or create new ones, my new column was nowhere to be found. So I tried to add it, got a warning about duplicate columns but nevertheless it showed up. Still though, error when I tried to check in or publish such pages and my edit field for this column didn't show either.

I have tried to go to my content type at the site collection level and push the changes down trough webs and lists as it says in advanced settings but that didn't help. I couldn't see my column in my list.

Why is it always such a hassle to update content types and page layouts through their definitions, reactivating features. Aren't you supposed to be able to do so? It's always the same thing in every project, content types and page layouts need to be changed and fields don't show up... Tell me you never had that kind of trouble, please...



1 Answer Found

Answer #1    Answered By: Cristopher Gould     Answered On: May 04

Think of the definition (in the Feature) as just an instruction to SharePoint to create  the contnet type  when the Feature is activated. Unfortunately reactivating (using the -force argument) does not push  the changes down. You can however get the changes to get pushed down using code and by looping through sites and lists  calling the .update(true) method though... you don't have to use the browser.

Didn't find what you were looking for? Find more on Adding columns to existing content types - updating lists Or get search suggestion and latest updates.