I have a list with about 15 managed metadata columns in it. Now I want to query that list using CSOM. I don't want to retrieve all the columns values so I limited the column values retrieved by using the include function. See code below
CamlQuery query = CamlQuery.CreateAllItemsQuery(); ListItemCollection items = pagesList.GetItems(query); ctx.Load(items, item => item.Include(i => i["Column1"])); ctx.ExecuteQuery();
When I execute the code I get the following error "Value does not fall within the expected range." For the first managed metadata columns in the list, this is working fine. So looks like the list view lookup threshold is the problem.
I also tried to retrieve the same column when querying only one item and this was working fine.
ListItem litem =pagesList.GetItemById(1); ctx.Load(litem, i => i["Column1"]); ctx.ExecuteQuery();
This is expected behavior if I look to the list view lookup threshold, because the following line is in the explanation of this threshold: "This does not apply to single item operations". See msdn post below. http://technet.microsoft.com/en-us/library/cc262787(v=office.15).aspx#ListLibrary
My question is, why do I have problems with the list view lookup threshold? I'm only trying to retrieve 1 managed metadatafield. Is there a way to solve this issue?