How to hide sharepoint 2013 user list fields? I need to hide fields in view mode on the userdisp.aspx page
How to hide sharepoint 2013 user list fields? I need to hide fields in view mode on the userdisp.aspx page
Thanks Tiago found the solution using Sharepoint Power Shell, see below the code:
$site = SPSite("http://www.seusite")
$web = $site.RootWeb
$spList = $web.SiteUserInfoList
$field = $spList.Fields["DataNascimento"]
$field.ShowInDisplayForm = $true
$field.ShowInEditForm = $true
$field.Update($true)
$spList.Update()
$web.dispose()
$site.dispose()
If you want to hide fields on a form from either Create / Edit / View, you can edit the content of the form by SharePoint Designer
.
Or, via PowerShell
, as the colleague there said, you can use the .ShowInDisplayForm/.ShowInEditForm
command by setting 'false'
or 'true'
to each specific field.