Search code examples
visual-studio-2010sharepointsharepoint-apps

Sharepoint Online: List & Features


I'm building a SP provider hosted app in Visual Studio. I just saw, that for each list I add to the project a new "Feature" is added, too. Can someone explain what the tasks of a feature are and how it is associated with the lists? Thank you!


Solution

  • You can see the feature as a container with yours SharePoint artefacts.

    Basically, if you need to define a list, you'll have to create a definition list. Then, you have to put this definition in a feature. When your app'll be launched. The feature will be activated and the list inside your feature will be deployed on your site.

    The features managment depends according to the developper. You can :

    • Put all in one feature. Sounds ok for small apps with one list.
    • Have one feature for the fields, on for the content type and one for the definition lists
    • Have one feature by fields/CT/list.

    To separate lists will provide you more intel in case of error. You'll know that your specific feature in error manage a specific list. And you'll directly analyse what's wrong in your list. (Useful when the error is "An error has occured during the activation on the feature xxxx-xxxx-xxxx ... The log aren't everytime explicit)

    In another hand, some developper'll tell that manage multiple features is an additional work. Up to you to weighing it up !

    Note : In a SharePoint-hosted app, all the features are scoped web.