0
votes

I am getting

"The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator"

while renaming site column in SharePoint online using CSOM. I have faced this issue in the past while fetching items from the large list but this is a different scenario, here I am just trying to rename the site column.

2

2 Answers

1
votes

This issue is caused by the Item Count exceed the list view threshold limitation. And No matter retrieve item or rename site column with CSOM, it will throw such exception.

For SharePoint Online, to come across this limitation, here are some way:

  1. Use indexed column.
  2. Reduce the list item and create multiple views which make sure the item count is less than list view threshold. More information please refer:

Office 365: How SharePoint Online handles List View Threshold

0
votes

I faced the same issue accessing the folders from Sharepoint online. One of my subfolder under Sites rootfolder had 6000+ subfolders, resulting to threshold limit error. So instead, I user alternative way to access only specific folder that I need using GetFolderByServerRelativeUrl function. Steps were...

  1. Get Online Context
  2. Get List of items. It will also provide the root folder.
  3. Using GetFolderByServerRelativeUrl, get only specific folder within this root folder. Below code may help further.

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;
    }

}