Hello,
We are trying to get the versions data of list items (SPList and not Document Library just to be clear) using CSOM in our console app. We found that we can get the versions data in SharePoint Online and also using JSOM.
But when we run the console app for SharePoint On Premise site to get the versions data we get the error as: "Field or property "Versions" does not exist."
List spList = web.Lists.GetByTitle("TestList");
CamlQuery query = new CamlQuery();
ListItemCollection items = spList.GetItems(query);
//clientcontext.Load(items, i => i.IncludeWithDefaultProperties(it => it.Versions));
clientcontext.Load(items);
clientcontext.ExecuteQuery();
if (items != null && items.Count > 0)
{
foreach (var item in items)
{
ListItemVersionCollection lVersions = item.Versions;
clientcontext.Load(lVersions);
clientcontext.ExecuteQuery();//This throws the mentioned error
}
}Could someone help us to know if getting versions data for ListItem works in SharePoint 2013 On Premise?
We checked this link https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365-september-2017 which is for SharePoint Online. Do we have any similar update for SharePoint 2013 on premise?