Hello Support,
I am struggle with a problem to update the user field (Responsible Person) in list item. Basically, I used following code:
ListItem item = list.GetItemById(26);
ctx.Load(item);
ctx.ExecuteQuery();
FieldUserValue userValue = new FieldUserValue();
User user = ctx.Web.EnsureUser("<logon name>");
ctx.Load(user);
ctx.ExecuteQuery();
userValue.LookupId = user.Id;
item.FieldValues["Responsible_x0020_Person"] = userValue;
item.Update();
ctx.ExecuteQuery();
I have debugged the item line by line. userValue.LookupId can be retrieved successfully. Before running ctx.ExecuteQuery, "Responsible Person" field was allotted the value. But after execution, the value was changed to null. Following is what I have referred:
https://blogs.msdn.microsoft.com/kaevans/2013/11/30/setting-a-sharepoint-person-or-group-field-value-with-csom/
http://passionatetechie.blogspot.com/2012/01/how-to-set-people-and-group-column.html
Appreciate your effort to have a check, and looking forwarding to your reply
Regards,
Freddie