powershell
powershell copied to clipboard
[BUG] Not working - Update to content type to associate the form customizer component id
Reporting an Issue or Missing Feature
Update to content type to associate the form customizer component id is not working... Tried all the 3 type of New,Edit and View. SPFx solution is already deployed and installed on the target site collection.
Just wanted to check if this is supported or this is just get property as of now in PnP Powershell?
Actual behavior
Update works fine without error but when we tried to read the property again it is showing empty.....Also we can see that when trying to click new button, it is still showing OOTB form and not custom Form
Steps to reproduce the behavior
Import-Module PnP.PowerShell
$siteURL="https://test.sharepoint.com/sites/MyLab"
Connect-PnPOnline -Url $siteURL -Interactive
$ContentTypeName= "Item"
$CTypes = Get-PnPContentType -List "FormCustomizerDemo"
foreach($contentType in $CTypes)
{
if($contentType.Name -eq $ContentTypeName)
{
Write-Host "Found"
# $contentType.DisplayFormClientSideComponentId = "e44c9692-60eb-47dc-bec1-f87ed396871a";
$contentType.NewFormClientSideComponentId = "e44c9692-60eb-47dc-bec1-f87ed396871a";
# $contentType.EditFormClientSideComponentId = "e44c9692-60eb-47dc-bec1-f87ed396871a";
$contentType.Update($false)
Write-Host $contentType.NewFormClientSideComponentId
}
}
What is the version of the Cmdlet module you are running?
1.11.0
Which operating system/environment are you running PnP PowerShell on?
- [x ] Windows
You are missing Invoke-PnPQuery
after the foreach loop.
It needs to be there to execute the update on the CTs
Any update on this @siddharth-vaghasia ?
@gautamdsheth - let me check this and get back to you.
@gautamdsheth - thanks for the correcting, yes...my bad.....adding Invoke-PnPQuery works fine...