Hi Patrick,
thank you, but this way is not acceptable for the client cause we display the version history to him and he will see # of versions different from the one he see in the view list
I found a solution for it like below using rest with bNewDocumentUpdate
parameter
$scope.updateMetadataNoVersion=function(fileUrl) {
var fld=$scope.SelectedFolder.replace(_spPageContextInfo.siteAbsoluteUrl, "");
var restSource ="";
if(fld.replace("lists/DepartmentDocuments","")=="")
restSource = currentWeb.get_url() + "/_api/web/lists/getbytitle('DepartmentDocuments')/rootfolder/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem";
else
restSource = currentWeb.get_url() + "/_api/web/getfolderbyserverrelativeurl('"+fld+"')/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem";
var dfd = $.Deferred();
$.ajax(
{
'url': restSource,
'method': 'POST',
'data': JSON.stringify({
'formValues': [
{
'__metadata': { 'type': 'SP.ListItemFormUpdateValue' },
'FieldName': 'ShareWith',
'FieldValue': '24'
}
],
'bNewDocumentUpdate': true,
'checkInComment': ''
}),
'headers': {
'accept': 'application/json;odata=verbose',
'content-type': 'application/json;odata=verbose',
'X-RequestDigest': $('#__REQUESTDIGEST').val()
},
'success': function (data) {
var d = data;
dfd.resolve(d);
},
'error': function (err) {
dfd.reject(err);
console.log(err);
}
}
);
return dfd.promise;
}
my problem now with user field it does not accept any value but it goes to the success function in the request
any suggestion please