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

Can't unfollow a document using JavaScript in SharePoint 2013

$
0
0

Hi, guys

I was trying to write a small JavaScript function to unfollow a document in SharePoint 2013. I thought this was pretty straight forward, but when I run my code nothing happens. No error in the console log, but the document isn't unfollowed. Clearly I'm missing something.

I've debugged each line of code. I get a context object, a following manager and an actorInfo object. All objects variables seemes okay, i.e. not "undefined". Can someone please have a quick look and tell me what I'm doing wrong?

Here's my code:

function unfollowDoc(url) {
    var clientContext = SP.ClientContext.get_current();
    var followingManager = new SP.Social.SocialFollowingManager(clientContext);

    var actorInfo = new SP.Social.SocialActorInfo();
    actorInfo.ContentUri = url;
    followingManager.stopFollowing(actorInfo);
}


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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