Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Change SPGroup Owner using JSOM

$
0
0

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



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>