Question

I'm looking into Sharepoint 2010 Feature upgrade framework and all over the net I'm seeing examples of how to upgrade a feature by adding a new field to a existing content type and this is done like this:

  <UpgradeActions>

<VersionRange BeginVersion="0.0.0.0" EndVersion="0.9.9.9">

  <ApplyElementManifests>

    <ElementManifest Location="SomeFunctionality_Iteration2\Elements.xml" />

  </ApplyElementManifests>



  <AddContentTypeField ContentTypeId="0x010073f25e2ac37846bb8e884770fb7307c7"

      FieldId="{536DC46C-DC26-4DB0-A97C-7C21E4362A85}" PushDown="TRUE"/>

  <AddContentTypeField ContentTypeId="0x010073f25e2ac37846bb8e884770fb7307c7"

      FieldId="{4E7A6719-011A-47EA-B983-A4941D688CA6}" PushDown="TRUE"/>

What i don't understand is how would i perform an upgrade to a feature which would rename,*delete* or change any other property a field declaratively from the content type the feature already deployed.

All over the net I'm seeing examples of how to add a Field, but how do i change properties of existing ones using Feature Versioning and Upgrading.

Thanks!

Was it helpful?

Solution

You have to do that using code in the Feature receiver (in Feature_Updating). There's no way to delete or rename a Field using CAML.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top