May 17 2017 02:49 AM
Hello All-
I am adding a column in custom view. Working fine, but while checking if this column exist in the view
getting unusual issue. There is no error but simply this code is not working. Debugger is not going inside if statement always going else and adding one more version column.
Code:
View customtview;
customtview = subjectSiteDocumentsLibrary.GetViewByName("All Documents");
subjectSiteContext.Load(customtview, v => v.ViewFields);
subjectSiteContext.ExecuteQueryRetry();
if (customtview.ViewFields.Contains("Version"))
{
}
else
{
customtview.ViewFields.Add("Version");
}
customtview.Update();
subjectSiteContext.ExecuteQuery();
Any help?
Sayan.
May 17 2017 05:05 AM
Have you tried this solution:
May 19 2017 02:06 AM
Thanks Pieter , it is working through internal names.