My function is :
function UpdatePerform() {
var clientContext = new SP.ClientContext(_spPageContextInfo.webAbsoluteUrl);
var oList = clientContext.get_web().get_lists().getByTitle(ListOnboarding);
var item = oList.getItemById($("#idC").val());
var Superior = $("#Superior").val();
var Employees = $("#SuperEmployeesior").val();
item.set_item('ImmediateSuperior', Superior);
item.set_item('EmployeesReportingToThisUser', Employees);
item.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded_SaveTo), Function.createDelegate(this, this.onQueryFailed_SaveTo));
}
When i want to update the person field, it empty it! can anyone help me please?
.val()method of jQuery returns a string. You need to probably use theEnsureUser-method on this string (if it's for exampledomain\user) and cast the result toNew-Object Microsoft.SharePoint.Client.FieldUserValue