https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/provision-sp-assets-from-package In the documentation it specifically told us to create fields, add to content type, then add the content type into the list. How do I create a simple list without having to create content type first?

Also I noticed an issue with this sample, the Content Type within the provisioned list isn't actually inheriting/defaulting to the added content type (Cost Center is not exist within Content Type area in the list):

image

But the columns are displayed as if the column belongs locally to the list, not site column. image

Any thoughts?

  • Can you check if the columns are listed under site columns? And if the content type is listed under the site content types? – baywet Apr 27 at 23:24
  • @baywet the columns are correctly in the content type. However I just want to create a simple list without having to create site columns/content type. – Jonathan Apr 28 at 3:58
up vote 1 down vote accepted

The sharepoint framework assets provisioning model relies on the feature framework provisioning model (a subset of it). It's generally a best practice to leverage site columns and content types for lists instead of defining everything in the list. However if you still want to go ahead, remove the content type definition, remove the content type reference and move the fields definitions in a fields node within the list definition to look like that https://msdn.microsoft.com/en-us/library/office/bb862047(v=office.12).aspx

I have tried this out. I had to remove the default content type references in the schema.xml. I have documented it in my post http://www.thesharepointguide.com/sharepoint-framework-provision-assets/

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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