I am updating RefCreated column in sharepoint list when new item is getting created. Problem is if 7 items are already there and 8th item is added by user all RefCreated field of items will get updated by that user. I want to update only current newly added item. I am using below code.
uploadFile = uploadFile.FinishUpload(uploadId, fileoffset, s);
ListItemCollection items = docs.GetItems(CamlQuery.CreateAllItemsQuery());
ctx.Load(items);
User currentUser = ctx.Web.CurrentUser;
ctx.Load(currentUser);
ctx.ExecuteQuery();
Logger.Info("valueD" + currentUser);
foreach (var item in items)
{
item["RefCreated"] = toaddress;
//item["ReferenceCreated"] = toaddress;
item.Update();
Logger.Info("valueD");
}
ctx.ExecuteQuery();