pnp / PnP-Provisioning-Schema

Office 365 Patterns and Practices - Remote Provisioning Schema
MIT License
159 stars 221 forks source link

Add content type definition at list level #555

Open Ruslan-Urban opened 3 years ago

Ruslan-Urban commented 3 years ago

In the current schema pnp:listInstance allows to reference content types defined at site level in the pnp:ContentTypeBindings element. There is no option to define content types at list level, which is currently supported by SharePoint, which includes adding list-level columns to such content types. sharepoint-powershell-add-field-to-list-content-type

This restricts from replicating of existing functionality during migrations. Re-defining of content types at site level doesn't work in all cases, e.g. when the content type is referencing fields defined at list level, and a field with exactly the same internal name exists in another list. The field GUIDs would also clash (see Issue #192).

It also causes errors in Get-PnpSiteTemplate.

In the following example, pay attention to the content type RFE: image

In the exported template the RFE content type 0x0120D520008CD19F86358D0F48945657A43A020469 becomes 0x0120D520 (Document Set), and the default content type becomes 0x0101 (Document) image

And, the default content type should be RFE, which is a document set, not a document. image

To overcome the limitations and address the issues, the following will be required:

Ruslan-Urban commented 3 years ago

Related: Issue #185

heinrich-ulbricht commented 2 years ago

Uh oh. Ran into this as well. I need to add a field to a list content type, not the site content type. This seems impossible right now? cc @PaoloPia

ValerasNarbutas commented 2 months ago

@Ruslan-Urban @PaoloPia @heinrich-ulbricht this still an issue right? I am trying to set default view to content type which is also document set to different default view as for document library default one. It seems in contentype schema were is line:

is were a way to change it via powershell during provisioning?

MrRCG5 commented 1 month ago

@Ruslan-Urban @PaoloPia @heinrich-ulbricht this still an issue right? I am trying to set default view to content type which is also document set to different default view as for document library default one. It seems in contentype schema were is line:

is were a way to change it via powershell during provisioning?

I am trying to attempt the same. I would like a PS script to update or set the Document Set > Welcome Page View > ViewId

I tried updating the SchemaXML but it is read-only. Any help is appreciated.