2

My feature should add some lists to a Sharepoint 2013 site. I have tried to add a list with ListDefinition and ListInstance to my project and only add the Instance to the feature which should be deployed, but it is not working.

When I only add a ListInstance to the project, I cannot customize and add Columns "the easy way with editor".

How can I add a ListInstance with my custom Columns without deploying a ListDefinition to the site with the feature?

I also dont want to write a huge punch of code for this problem, because I am going to add many lists in the feature with more features.

1

Forget about features and list definitions for this! Instead, provision your site columns, site content types and lists with client-side code (CSOM/REST API). Use the Office 365 Dev PnP Provisioning Engine or the Office Dev PnP PowerShell CmdLets to provision SharePoint artifacts without having to code much yourself.

Alternatively, define your columns and content types in the Content Type Hub and publish them. You can then easily create a new list and add the required content types(s). To have it as a list template in the UI; save a customized one as a template (.STP file) and upload it to the list gallery in all applicable sites.

  • But it is very fast and convenient to just add a feature and some lists and columns in the editor. Only dont want to have the definitions in my Sharepoint portal when you want to create new list from GUI. – Florian Leitgeb Mar 10 '17 at 12:46
  • You have added the same url in both links. – Florian Leitgeb Mar 10 '17 at 12:48
  • List definitions are only available with SharePoint on-premises. It's not possible with SharePoint Online. That's why I recommend not to consider list definitions anymore. But you can upload .stp files though! See this article on MSDN: msdn.microsoft.com/en-us/pnp_articles/… – Lars Fastrup Mar 11 '17 at 13:19

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.