Frage

Ich habe eine Liste in einer SharePoint-Site, an der ich einige Daten sparen kann.Diese Liste wurde auf einem Feature-Aktivierungsprozess vor Monaten erstellt!

Jetzt habe ich neue Verbesserungen erstellt, nachdem ich 2 neue Spalten zum Code hinzugefügt habe (in der Liste des Listenerstellungsvorgangs in meiner Funktionsaktivierungsmethode).

Meine Frage kommt hierher: Kann ich meine Lösung neu einsetzen und meine Funktion erneut aktivieren, ohne Daten in der Liste zu verlieren?

Was ist der beste Weg, das zu tun?

War es hilfreich?

Lösung

For such cases, we usually have a Code Upgrader feature which adds new columns to the list, set default values and so on..

You need to grab the existing list and add the new columns, it should work fine.. And you just need to activate this Code Upgrader Feature

Andere Tipps

Instead of having a completely new feature, as Arsalan proposes, you can use the Feature Upgrade framework (which is actually mentioned in a comment by tyshock above).

Basically, what you have to do is using the Feature Version attribute, and then implement code to handle the FeatureUpgrading event in a Feature Event Receiver. See best practices here

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange
scroll top