Updating Content Type property EditFormClientSideComponentId does not work #2158
-
The value will not be persisted. The code I used:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I also have the same concern. There is no documentation on how to accomplish this. If I find it I will reply to you here. |
Beta Was this translation helpful? Give feedback.
-
This worked for me. Good Luck! #Login Get Context$clientContext = Get-PnPContext Give target content type name over here$targetContentType = Get-PnPContentType -Identity "Content Type Title" -List "Your List" Set target content type read only$targetContentType.EditFormClientSideComponentId = '8edc4f83-3e73-4d31-9828-b67b7b786667' Update(UpdateChildren – bool), this value indicates whether the children content type(inheriting from this Content Type) needs to be updated. 0 = False, 1 = True$targetContentType.Update(0) $clientContext.ExecuteQuery() |
Beta Was this translation helpful? Give feedback.
This worked for me. Good Luck!
#Login
Connect-PnPOnline -Url http://MyServer/sites/MySiteCollection -Credentials $creds
Get Context
$clientContext = Get-PnPContext
Give target content type name over here
$targetContentType = Get-PnPContentType -Identity "Content Type Title" -List "Your List"
Set target content type read only
$targetContentType.EditFormClientSideComponentId = '8edc4f83-3e73-4d31-9828-b67b7b786667'
Update(UpdateChildren – bool), this value indicates whether the children content type(inheriting from this Content Type) needs to be updated. 0 = False, 1 = True
$targetContentType.Update(0)
$clientContext.ExecuteQuery()