I'm trying to change group owner of a Group by adding another SP group, here is code:
var sourceSpGroup = groupCollection.getByName(groupName1);
var toAddGroup = groupCollection.getByName('SPGroupToAdd');
clientContext.load(sourceSpGroup);
clientContext.load(toAddGroupp);
clientContext.executeQueryAsync(Function.createDelegate(this, this.GetCustGroupDetailsSuccess), Function.createDelegate(this, this.GetCustGroupDetailsFailed));
function GetCustGroupDetailsSuccess() {
sourceSpGroup.set_owner() = toAddGroupp;
}However I am getting the error 'Cannot assign to a function result' in console in the line
sourceSpGroup.set_owner() = toAddGroupp;
I could not find any example in MSDN for this property of SP.Group.Owner hence any help would be appreciated.
-- The opinions expressed here represent my own and not those of anybody else -- http://manojvnair.blogspot.com