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 =
                      <FieldRef Name='File_x0020_Type'/><Value Type='Text'>pdf</Value>
                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));

Now, they all load properly. However, changing them like this:

                        item["Barcode"] = "Rafal was here";
                        item["Document_x0020_Type"] = "Here as well";

...does not do anything. What am I doing wrong?


Did you try running this after update:

  • God, that took me a bloody hour of trying and figuring out! Thanks so much, eirikb! – Rafał Saltarski Sep 20 '12 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.