I am working on Sharepoint 2013 site, I need to manually add value to metadata column "Network" in Library "Drop Off Library". I check if a particular word in present in the document and then I try to update the item. When I try updating "Network" column and other Choice column "PickUp". My metadata column does not get updated but Choice Column gets updated. Below is my code. Please note I am using CSOM.
foreach (Microsoft.SharePoint.Client.ListItem item in ItemCol)
{
foreach(Term Tstring in termColl)
{
object findText = Tstring.Name;
word.Selection.Find.ClearFormatting();
if (word.Selection.Find.Execute(ref findText,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing))
{
item.File.CheckOut();
item["Network"] = "3;#Cartoon"; //My term:cartoon with 3 as term id(checked in TaxonomyHiddenList)
item["PickUp"] = "Yes";
item.Update();
context.Load(item);
lists.Update();
context.ExecuteQuery();
item.File.CheckIn("Done", CheckinType.MajorCheckIn);
}
}