当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 如何在 SharePoint Online 中禁用快速编辑?

作者:精品下载站 日期:2024-12-14 15:46:28 浏览:17 分类:玩电脑

如何在 SharePoint Online 中禁用快速编辑?


要求:在 SharePoint Online 中禁用快速编辑。

快速编辑是 SharePoint Online 中的一项出色功能,允许用户快速更改列表项和文档元数据。虽然这是一个方便的功能,但有时您可能因某种原因需要禁用快速编辑。在这篇文章中,我将引导您了解如何在 SharePoint Online 中为用户关闭快速编辑。让我们开始吧!

我们有一个包含“项目运行状况”字段的项目跟踪列表,该列表由事件接收器根据特定参数和业务逻辑进行更新。因此,我们使用以下方法在 SharePoint Online 中隐藏该字段:SharePoint Online:如何从列表表单中隐藏列?但是,用户可以进入列表的“快速编辑”模式并在那里获取隐藏字段!尽管该列在新建和编辑表单中被隐藏,但 SharePoint Online 快速编辑仍然显示隐藏字段,并且我们希望禁用 SharePoint Online 列表的快速编辑。

[玩转系统] 如何在 SharePoint Online 中禁用快速编辑?

如何在 SharePoint Online 中禁用“在网格视图中编辑”(快速编辑)?

要在 SharePoint Online 中禁用快速编辑,请按照以下步骤操作:

  1. 导航至列表 >> 单击设置 >> 列表设置
  2. 单击列表设置页面下的“高级设置”链接。
  3. 在“高级设置”链接中,向下滚动,然后在“快速属性编辑”选项下,为“允许使用快速编辑编辑此列表中的项目吗?”选择“否”。然后单击“确定”。

这会禁用 SharePoint Online 列表中的快速编辑,即使在经典模式下也是如此。

[玩转系统] 如何在 SharePoint Online 中禁用快速编辑?

PowerShell 在 SharePoint Online 中禁用快速编辑

要关闭“在网格视图中编辑”,请使用以下 PowerShell 脚本:


Import-Module Microsoft.Online.SharePoint.Powershell

#Set Parameters
$SiteURL="https://crescent.sharepoint.com/sites/Retail"
$ListName ="Projects"

#Get Credentials to connect
$Cred = Get-Credential

Try{
    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
    
    #Get the List
    $List = $Ctx.Web.Lists.GetByTitle($ListName)
    $Ctx.Load($List)

    #Disable Quick Edit
    $List.DisableGridEditing = $true
    $List.Update()
    $Ctx.ExecuteQuery()
    }
Catch {
    Write-host -f Red "Error:" $_.Exception.Message
}

[玩转系统] 如何在 SharePoint Online 中禁用快速编辑?

您还可以使用 PnP PowerShell 脚本禁用快速编辑模式 SharePoint Online 列表:


#Parameters
$SiteURL = "https://Crescent.sharepoint.com/sites/Marketing"
$ListName = "Projects"
 
#Connect to the site
Connect-PnPOnline $SiteURL -Interactive

#Get the List 
$List = Get-PnPList -Identity $ListName

#Disable Quick Edit in SharePoint Online List
$List.DisableGridEditing = $True
$List.Update()
Invoke-PnPQuery

要返回快速编辑,只需将“DisableGridEditing”设置为“$False”即可。

这是另一篇在 SharePoint On-premises 中隐藏快速编辑的文章,使用:如何在 SharePoint 中禁用快速编辑?

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯