1

I'm trying to update some fields on SPListItem but i want to prevent Modified Date/ModifiedBy fields also don't want new version. So SystemUpdate(false) is used for my case but it can not prevent that fields and change that fields with DateTime.Now and Current User. Do I missing something?

string uploadedDocfolderPath = UploadedDoc86umentsLibName + "/" + applicationNo;
SPFolder folderArchive = archiveWeb.GetFolder(uploadedDocfolderPath);
foreach (SPFile fileArchive in folderArchive.Files)
    {
        fileArchive.Item[Fields] = .....
        fileArchive.Item.SystemUpdate(false);
    } 

1 Answer 1

0

Try enclosing your update inside a try, catch, finally that handles disabling/enabling other events firing.

try
{
    this.EventFiringEnabled = false;
    fileArchive.Item[Fields] = .....
    fileArchive.Item.SystemUpdate(false);
}
catch (Exception ex)
{
    // Handle exception
}
finally
{
    this.EventFiringEnabled = true;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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