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.



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


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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