Maximum SharePoint CAML Request Size

I am running a campoint sharepoint query where I want to check that the field on an element is equal to one of many values. I am doing this dynamically and maybe want to check many hundreds of values.

I found that when I was executing a query with 780 OR elements, I received an error related to server memory. Obviously, this is a variable in different environments, but I'm looking for some recommendations that suggest the maximum length of the request that I have to close.

Thank!

+3
source share
2 answers

How about using ContentIterator ? http://community.zevenseas.com/Blogs/Robin/Lists/Posts/Post.aspx?ID=122

- . " " , "FeatureId" :

SPList styleLibrary = rootWeb.Lists.TryGetList("Style Library");
SPFolder folder = styleLibrary.RootFolder;
ContentIterator ci = new ContentIterator();
ci.ProcessFilesInFolder(
    styleLibrary,
    folder,
    true,
    new ContentIterator.FileProcessor((SPFile f) =>
    {
        // Check the FeatureId property the file been "stamped" with
        if (f.Properties.ContainsKey("FeatureId"))
        {
            if (String.Equals(f.Properties["FeatureId"] as string, featureId, StringComparison.InvariantCultureIgnoreCase))
            {
                if (f.Level == SPFileLevel.Checkout)
                    f.CheckIn(String.Empty, SPCheckinType.MajorCheckIn);
                if (f.Level == SPFileLevel.Draft)
                    f.Publish("");
            }
        }
    }),
    new ContentIterator.FileProcessorErrorCallout((SPFile f, Exception Ex) =>
    {
        //Define the action I need to do if an error occur
        return false;
    }));
+2

SPList.Folders, ...

+1

Source: https://habr.com/ru/post/1796693/