2

I have my custom list template. The template initially described a field Position using the following XML element:

<CHOICES>
  <CHOICE>1</CHOICE>
  <CHOICE>2</CHOICE>
</CHOICES>

An instance of the list was created on production. Dozens of items were added into the list since that time.

Recently, I received a request to add one more position to let editors also set position #3. I have updated the template, now I have:

<CHOICES>
  <CHOICE>1</CHOICE>
  <CHOICE>2</CHOICE>
  <CHOICE>3</CHOICE>
</CHOICES>

After deployment, position #3 is shown for items in new instances of the list template, but the old list still shows only positions #1 and #2. Could you tell me why it happens? How can I fix it in a simple/proper way? Is there another way to fix it except to create a feature which will do it in receiver programmatically?

Even more: when I copy existing item from the old list (which has only positions #1 and #2) into a new list instance (which is also has position #3), position #3 is removed from my new list, so I cannot create a new item and chose position #3 as the field value.

UPD: I have downloaded list template (stp file) of the old list. The file was created using SP UI "Save list as template" link. I do not see position #3 in manifest.xml.

Thank you.

3
  • How was this list template originally created? Via the SP userinterface or programmatically by using List Definition?
    – user2536
    Mar 15, 2012 at 13:19
  • Hello Dandroid, thank you for your answer. The list template was created using list definition (XML file). The list instance was created via SP UI.
    – Antipod
    Mar 15, 2012 at 13:25
  • From an approach standpoint, this is a really good use case for Content Types. You can maintain the content type centrally including those choice values and then updates are pushed to all of the lists without having to touch the template. Mar 15, 2012 at 14:56

1 Answer 1

1

When you modify a list template, the changes are only visible in new list instances you create after the modification. This is by-design.

Unfortunately you need to manually modify existing list instances, or create a small application that will loop through all SPWebs and lists on each site, and modify the choices.

2
  • Jussi, thank you for the information. Could you tell me is it true only for choices? I am asking because when I add a new column into schema.xml and redeploy, the column is added into the old list also. So, why does it work with columns, but do not work with choices? Is it also by design? Thank you.
    – Antipod
    Mar 15, 2012 at 15:28
  • When you add a new field (or column), you're actually adding a field definition. But, when you're adding choice to an existing field definition, you're modifying the properties (default field data) of an existing field. I believe the default values are not pushed down to list instances in order not to mess with existing data. Some list instances might have been modified after they've been created from the template, so modifying the actual allowed field values (choices) might not be good.
    – Jussi Palo
    Mar 19, 2012 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.