You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.
After using $field.SetShowInDisplayForm($false) the field should no longer be displayed in the Dispform.aspx form
Observed Behavior
The field is still displayed on the form. In order to hide it, it is necessary to use the SetShowInEditForm method, hiding it in the dispform and in the editform.
It is not possible to hide a field in the dispform only by powershell.
Just tried this also - with a slightly different command for '$field' $field = Get-PnPField -List "Demo list" -Identity "TestColumn"
I tired the methods for 'SetShowInDisplayForm' and 'SetShowInEditForm' - no impact. Perhaps they are only for CLASSIC mode. Not modern. Even setting a field to HIDDEN or READONLY - has no impact.
But - I was able to set the 'SCHEMAXML' - and it worked (hid the field in edit or display mode)
NOTE - I think you also have to set 'Hidden=False' - for it to work...
This is by design on the SharePoint side, with new modern list forms the Display form is actually an Edit form also.
These settings still work if the list is placed in Classic mode
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
####Which PnP repository should you use to report the issue?####
Category
[x] Bug
[ ] Enhancement
Environment
[x] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013
Expected or Desired Behavior
After using $field.SetShowInDisplayForm($false) the field should no longer be displayed in the Dispform.aspx form
Observed Behavior
The field is still displayed on the form. In order to hide it, it is necessary to use the SetShowInEditForm method, hiding it in the dispform and in the editform.
It is not possible to hide a field in the dispform only by powershell.
Steps to Reproduce
Connect-PnPOnline -Url
$field = Get-PnPField -Identity -List $field.SetShowInDisplayForm($false)
$field.Update()
$field.Context.ExecuteQuery()
Thanks!
The text was updated successfully, but these errors were encountered: