I have a pages library in sharepoint online with 2 views.
Custom view - (I have added a condition in the view based on a content type) - contains 500 items, It has got 100 items where title starts with "abc"
Default view - It has 4 items and all items have title starting with "abc" (Don't know why it is showing only 4 items, there is no filter condition and I am expecting all 504 items to appear in the view) - but shows only 4 items
I want to write a CAML query in CSOM on custom view where title begins with "abc"
<View>
<ViewFields>
<FieldRef Name="Title" />
</ViewFields>
<Query>
<Where>
<BeginsWith>
<FieldRef Name="Title" />
<Value Type="Text">abc</Value>
</BeginsWith>
</Where>
</Query>
</View>
Query executes fine but shows only 4 items, looks like it is showing items from default view but I want to show items from custom view.
I can load my custom view and use view query
Microsoft.SharePoint.Client.View view = oList.Views.GetByTitle("Custom View");
rentalSiteClientContext.Load(view);
rentalSiteClientContext.ExecuteQuery();
query.ViewXml = view.ViewQuery
ListItemCollection collListItems = oList.GetItems(query);
rentalSiteClientContext.Load(collListItems);
rentalSiteClientContext.ExecuteQuery();
this is still returning 4 items.