pnpcore
pnpcore copied to clipboard
LoadItemsByCamlQueryAsync not working with FolderServerRelativeUrl
Category
- [x] Bug
Describe the bug
When querying with LoadItemsByCamlQueryAsync on a semi large list (10000 items) querying a specific folder throws REST exception
Steps to reproduce
This is working
var viewXml = $@"<View Scope='RecursiveAll'><RowLimit Paged='TRUE'>{rowLimit}</RowLimit><Where><Eq><FieldRef Name='FSObjType' /><Value Type='Integer'>1</Value></Eq></Where><ViewFields><FieldRef Name='ID' /><FieldRef Name='FileRef' /></ViewFields></View>";
await sourceList.LoadItemsByCamlQueryAsync(new CamlQueryOptions() { ViewXml = viewXml, PagingInfo = nextPage }
This throws the item limit exception with the same viewXml
await sourceList.LoadItemsByCamlQueryAsync(new CamlQueryOptions() { ViewXml = viewXml, FolderServerRelativeUrl = sourceList.RootFolder.ServerRelativeUrl + "/Testfolder", PagingInfo = nextPage });
Expected behavior
Results
Environment details (development & target environment)
Visual Studio latest version
Additional context
Thanks for your contribution! Sharing is caring.