I am trying to get a collection of .pdf files from a certain document library, as well as their fields and values. I need three of them - DisplayName, "Barcode"(custom) and "Document Type"(also custom).
Currently I am getting the list collection like this
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml =
@"<View>
<Query>
<Where>
<Eq>
<FieldRef Name='File_x0020_Type'/><Value Type='Text'>pdf</Value>
</Eq>
</Where>
</Query>
</View>";
try
{
ListItemCollection listItems = CurrentChosenLibrary.GetItems(camlQuery);
clientcontext.Load(listItems, items => items.Include(
item => item.DisplayName,
item => item["Barcode"],
item => item["Document_x0020_Type"],
item => item.HasUniqueRoleAssignments));
clientcontext.ExecuteQuery();
Now, they all load properly. However, changing them like this:
item["Barcode"] = "Rafal was here";
item["Document_x0020_Type"] = "Here as well";
item.Update();
...does not do anything. What am I doing wrong?