How to add lookup value (Title ) column "achat" : lookup field
enter c
if (itemEnum.moveNext()) {
// update the item
var current = itemEnum.get_current();
// add lookup field
var lkfieldsomthing = new SP.FieldLookupValue();
var Name = $("#txt").val();
lkfieldsomthing.set_lookupValue(Name);
current.set_item('achat', lkfieldsomthing);
current.update();
clientContext.load(current);
clientContext.executeQueryAsync(
function(sender, args) {
// handle successful update
},
function(sender, args) {
// handle error
});
}