I have the following code inside my RER:-
foreach (ListItem currentFilingSystemItem in collListItem)
{
Folder folder = context.Web.GetFolderByServerRelativeUrl(context.Web.ServerRelativeUrl + "/library3/" + currentFilingSystemItem["DealName"].ToString());
context.Load(folder);
context.ExecuteQuery();
folder.MoveTo(context.Web.ServerRelativeUrl + "/ArchDocs/" + currentFilingSystemItem["DealName"].ToString());
folder.Update();
context.Load(folder);
context.Load(folder.Files);
context.Load(folder.Folders);
FileCollection files = folder.Files;
FolderCollection folders = folder.Folders;
context.ExecuteQuery();
foreach (File f in files)
{
ListItem item = f.ListItemAllFields;
context.Load(item);
context.ExecuteQuery();
item["DealStage"] = currentFilingSystemItem["DealStage"];
item.Update();
context.ExecuteQuery();
}
foreach (Folder fo in folders)
{
ListItem item = fo.ListItemAllFields;
context.Load(item);
context.ExecuteQuery();
item["DealStage"] = currentFilingSystemItem["DealStage"];
item.Update();
context.ExecuteQuery();
}
where i am trying to change a managed metadtametadata column named "DealStage" using this item["DealStage"] = currentFilingSystemItem["DealStage"];
for both File and Folders, but my above code will not raise any exception, but the DealStage
will not get update! can anyone advice on this please?
Thanks