How to update a SPListitem whithout change its “modified” and “modified By” column value?

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/195380

  •  09-12-2020
  •  | 
  •  

Pergunta

I have to update only one column of Sharepoint list in server side console application.

However, if i try to update the SPListitem , the "modified" and "modified by" column will be auto update.. So how to update the list item without change the "modified" and "modified By" column value?

some code:

foreach (var item in items)
{
    //get itemsite, itemsubsite, fileURL andimageData by item;
    web.Files.Add(Path.Combine(itemsite, itemSubsite, fileURL), nImageData, true);//to replace the same file..
}

trying:

foreach (var item in items)
{
     //get itemsite, itemsubsite, fileURL andimageData by item;
    DateTime modified = (DateTime)doc["Modified"];
    string modifiedBy = (string)doc["Modified By"];
    web.Files.Add(Path.Combine(itemsite, itemSubsite, fileURL), nImageData, true);
    doc["Modified"] = modified;
    doc["Modified By"] = modifiedBy;
    item.Update();//error
}

Nenhuma solução correta

Outras dicas

 foreach (var item in items)
{
    item["columnOne"] = "SharePoint";
    item.SystemUpdate();
}

use it it like this. Instead of update, use systemupdate

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top