powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[BUG] Not working - Update to content type to associate the form customizer component id

Open siddharth-vaghasia opened this issue 2 years ago • 1 comments

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

siddharth-vaghasia avatar Jul 29 '22 07:07 siddharth-vaghasia

You are missing Invoke-PnPQuery after the foreach loop. It needs to be there to execute the update on the CTs

gautamdsheth avatar Aug 09 '22 14:08 gautamdsheth

Any update on this @siddharth-vaghasia ?

gautamdsheth avatar Aug 23 '22 14:08 gautamdsheth

@gautamdsheth - let me check this and get back to you.

siddharth-vaghasia avatar Aug 31 '22 03:08 siddharth-vaghasia

@gautamdsheth - thanks for the correcting, yes...my bad.....adding Invoke-PnPQuery works fine...

siddharth-vaghasia avatar Sep 04 '22 05:09 siddharth-vaghasia