0

My Scenario:

I have a SharePoint-hosted app with several Lists, Content Types and Site Columns. Now I would like to add some new choices to an existing Site Column (Choice Field).

The Problem:

When upgrading the app, only the Site Column and the Site Content Types are updated. The List Content Types and the List Columns still have the old choices.

The questions:

  • Is there a declarative way to push down the changes to the List instances?
  • Is there a mechanism to catch the upgrade event to inject custom CSOM code?
0

All of the SharePoint components that are deployed to the app web are contained in Web-scoped Features in the app package. For that reason, updating these components is a matter of updating one or more of the Features. This process has not changed since SharePoint 2010 and is documented in How to: Add Elements to an Existing Feature in the SharePoint 2010 SDK. Other articles in the Upgrading Features node may be helpful also, but consider that apps must not include custom code on the SharePoint server, so some aspects of Feature upgrading in SharePoint 2010 are not relevant to updating apps. For example, you can't use the CustomUpgradeAction element when you upgrade the Feature of an app for SharePoint.

Reference : https://msdn.microsoft.com/en-us/library/office/dn265911.aspx

  • The question is still, how to push down the changes in a SharePoint-hosted app. In SharePoint 2010 you could use code to push the changes. – Mr_T Mar 5 '15 at 13:25
  • As you said: This process has not changed since SharePoint 2010. That is really the problem, because you can "fix" the behaviour with custom code, which seems to be impossible in SharePoint-hosted apps. – Mr_T Mar 5 '15 at 13:26
  • What do you mean by "fix" the behavior ? When you added choices, did you add the "upgradeActions" tag in the feature manifest and specify which column you want to update ? – KhalilG Mar 5 '15 at 13:30
  • In SharePoint 2010/2013/apps changes to existing site columns are not pushed down the lists. This is what I want to fix. I added the "UpgradeActions" tag and specified the Elements.xml files of the Field, Content Types and List Instance. How do you specify which column you want to update? – Mr_T Mar 5 '15 at 13:36
0

According to Steve Curran (MVP) it seems to be impossible to have declarative way of handle the site column lifecycle:

Link to MSDN Forum Entry

In my view Microsoft has to provide a better mechanism than using custom code with every page load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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