I have an issue with updating an item in ItemUpdated event.
Basically on ItemUpdated, I would like to reupdate that item by setting some properties, because it is a docx I have to do it in ItemUpdated.
BUT I get an error which says the following:
{"The file test.docx has been modified by user on "}
I have this code, which trows this error:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPWeb web = properties.OpenWeb())
{
var list = web.Lists[properties.ListTitle];
SPListItem listItem = list.GetItemById(properties.ListItem.ID);
listItem[lookUpFieldName] = "some value";
listItem.SystemUpdate(false);
}
});
I thought that open a new instance of SPWeb with this item would solve the problem, but it didn't. Anyone has any diea?