$WebUrl = "http://sitecollectionurl"
Write-Host "Opening Web" $WebUrl
$web = Get-SPWeb $WebUrl
$list = $web.Lists["ListName"];
$FieldGuid = New-Object System.Guid("cc9576b6-a166-47c9-bd89-7f47a3237e03");
$Field = $list.Fields[$FieldGuid];
$Field.ShowInNewForm = $false;
$Field.ShowInDisplayForm = $true;
$Field.ShowInEditForm = $false
$Field.Update();
$list.Update();
<span style="font-size: 14px; white-space: normal;">
</span>
Introduction
Power shell command to hide a particular column in a SharePoint list from the newform and editform.
Using the code
Use the below power shell command to hide a particular column in a SharePoint list from the newform and editform.
Here, replace the $WebUrl with your site collection URL, and replace the "ListName" with your SPList name.
And replace the Guid"cc9576b6-a166-47c9-bd89-7f47a3237e03" with the id of the field to be hidden.
For getting the id of the field , you can use 'SharePoint Manager' tool and will be downloaded from here. Its from codeplex and it is free.
本文介绍如何使用PowerShell命令来实现在SharePoint列表的新建和编辑表单中隐藏特定的列。通过调整示例代码并替换必要的参数,如网站集合URL、列表名称及待隐藏字段的GUID,即可实现需求。
3万+

被折叠的 条评论
为什么被折叠?



