I must set a source group to field "Assigned to" in task list. I tried with SP.FieldUser object but it don't working. How do this programmatically from java script?
I tried achive this with that function:
function setSourceTaskListFields() {
var appContextSite = new SP.AppContextSite(context, hostweburl + "/" + subWebUrl);
var field = new SP.FieldUser(context);
field = appContextSite.get_web().get_lists().getByTitle("Aufgaben").get_fields().getByInternalNameOrTitle("AssignedTo");
field.set_selectionGroup(6);
field.update();
context.load(field);
context.executeQueryAsync(setSourceTLFSuccess, setSourceTLFFail);
}
function setSourceTLFSuccess() {
alert("field's source group success added");
}
function setSourceTLFFail(sender, args) {
alert(args.get_message());
}But this code was returned error "Object doesn't support property or method 'set_selectionGroup".
Please for help.