I have created a SPFx Extension of the new type "Form Customizer". I found no specific information on how to attach the custom forms to the list/content-type. I have read the information from Andrew Connells article
The relevant part is as follows:
You then need to link the form up with a content type on the list. Even if the list has no content types, it’s got a single default content type. We now have six (6) new properties on the content type within the list in the format of ContentType. [Disp|Edit|New]FormClientSideComponent[Id|Properties]. Similar to how the other extensions work, you set the extension’s unique component ID as the content type form’s ClientSideComponentId which tells the SPFx which extension to load. The associated ClientSideComponentProperties lets you provide additional configuration information in the type of an JSON string for this instance. So, to deploy this, you’ll need to set the values of these properties on the content type within the list instance in production. That can be done through the API such as using the SharePoint REST API, CSOM, or one of the helper utilities like PnP PowerShell or the CLI for Microsoft 365
Does anybody solved this already and can help?
Update: The Code, I used to assign the component to the list content-type:
Import-Module PnP.PowerShell
$siteURL="https://contoso.sharepoint.com/sites/xxx"
Connect-PnPOnline -Url $siteURL -Interactive
$ContentTypeName="ZZZ"
$CTypes = Get-PnPContentType -List "List2"
foreach($contentType in $CTypes)
{
if($contentType.Name -eq $ContentTypeName)
{
$contentType.DisplayFormClientSideComponentId = "50ebd4b2-04f4-42fb-af43-953e226179f0";
$contentType.NewFormClientSideComponentId = "50ebd4b2-04f4-42fb-af43-953e226179f0";
$contentType.EditFormClientSideComponentId = "50ebd4b2-04f4-42fb-af43-953e226179f0";
$contentType.Update($false)
}
}
As I wrote in a comment, the code is working, but my custom Forms won't render. The default Forms of the list are still associated.