Sharepoint edit group title using JSOM
function setSomeUsers(OldTitle,newTitle) {
var clientContext = new SP.ClientContext.get_current();
var collGroup = clientContext.get_web().get_siteGroups();
var oGroup = collGroup.getByName(OldTitle);
oGroup.set_title(newTitle);
oGroup.update();
clientContext.load(oGroup );
clientContext.executeQueryAsync(Function.createDelegate(this, this.onSetQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));}
function onSetQuerySucceeded() {
alert(this.oGroup .get_title() + " added.");
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
No comments:
Post a Comment