I try to follow a page with JavaScript Object Model. My solution is based on many examples in the web and should work...

var siteActorInfo = new SP.Social.SocialActorInfo();        

if (siteInfo.Followed)

clientContext.executeQueryAsync(function () {
    if (onSuccess) onSuccess();
}, function (a,error) {
    if (onError) onError(error.get_message());

But when I try to follow or unfollow the page, I get this error:

Specified argument was out of the range of valid values. Parameter name: actor.ActorType

The SP.Social.SocialFollowingManager is initialized in another function and generally works.

It was not a problem to retrieve the list of followed sites.

I don't understand, whats the problem here.

Instead of 4 I also tried SP.Social.SocialActorTypes.sites, but this makes, no difference of course, because the value of the property is 4.

1 Answer 1


You can isolate the problem by trying to execute below in Console and check if error is still appearing

var context = SP.ClientContext.get_current();
var socialManager = new SP.Social.SocialFollowingManager(context);
var socialSite = new SP.Social.SocialActorInfo();

    function() { alert('Sites followed!'); },
    function(sender, args) { alert('Error: ' + args.get_message()); });
  • With the isolated code it works. At the end, I was successful with my code but I do not know, what ever has been the problem. I'm pretty sure SP.Social.SocialActorType.site had the value 4 this morning. Now it is 2 and using a 4 gives the quoted error, what makes sense. But using the enum I got the same error message. Or I had silly caching problems and worked on old code. Nevermind! Now it works. Thanks :) May 4, 2015 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.