【发布时间】:2023-12-22 09:02:01
【问题描述】:
我来了
“尝试的操作被禁止,因为它超出了管理员强制执行的列表视图阈值”
使用 CSOM 在 SharePoint Online 中重命名网站栏时。我过去在从大列表中获取项目时遇到过这个问题,但这是一个不同的场景,这里我只是想重命名网站栏。
【问题讨论】:
标签: sharepoint sharepoint-online csom
我来了
“尝试的操作被禁止,因为它超出了管理员强制执行的列表视图阈值”
使用 CSOM 在 SharePoint Online 中重命名网站栏时。我过去在从大列表中获取项目时遇到过这个问题,但这是一个不同的场景,这里我只是想重命名网站栏。
【问题讨论】:
标签: sharepoint sharepoint-online csom
此问题是由项目计数超过列表视图阈值限制引起的。并且无论使用 CSOM 检索项目还是重命名站点列,都会抛出此类异常。
对于 SharePoint Online,若要克服此限制,请使用以下方法:
Office 365: How SharePoint Online handles List View Threshold
【讨论】:
我在从 Sharepoint 在线访问文件夹时遇到了同样的问题。我的站点根文件夹下的一个子文件夹有 6000 多个子文件夹,导致阈值限制错误。因此,我使用替代方法来仅使用 GetFolderByServerRelativeUrl 函数访问我需要的特定文件夹。步骤是...
private Folder GetSubFolder(Web web, Folder rootFolder, string subFolderName)
{
Folder subFolder = null;
try
{
//If folder exists, get the folder form Sharepoint Cloud
subFolder = web.GetFolderByServerRelativeUrl(rootFolder.ServerRelativeUrl + "/" +subFolderName);
web.Context.Load(subFolder);
web.Context.ExecuteQuery();
}
catch (ServerException ex)
{
subFolder = null;
}
return subFolder;
}
}
【讨论】: