Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top