I'm trying to get list of recommended users to follow using ConnectAPI method getRecommendationForUser.

Syntax from the docs, getRecommendationForUser(String, String, ConnectApi.RecommendationActionType, String) Returns the recommendation for the context user for the specified action and object ID.

What I'm trying to do,

List values = ConnectApi.RecommendationActionType.values(); System.debug(ConnectApi.getRecommendationForUser('Internal',userinfo.getuserID(), values[0], userinfo.getuserID())); // values[0] is follow;

I get compilation error Method does not exist or incorrect signature: ConnectApi.getRecommendationForUser(String, String, ConnectApi.RecommendationActionType, String)

Not sure what is the mistake in the syntax. Can anyone see any syntax issues? Appreciate any help.


1 Answer 1


You need to add the name of the class. The method call should be like this:



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .