0
global  List<ConnectApi.RecommendationCollection> getRecom()
{
  List< ConnectApi.RecommendationCollection> recom =ConnectApi.Recommendations.getRecommendationForUser(null,'xxxxxxxxx00IbK8','follow','follow');
    return recom ;
}

I am trying to write code like above but getting error

Compile Error: Method does not exist or incorrect signature: ConnectApi.Recommendations.getRecommendationForUser(NULL, String, String, String) at line 11 column 53

1

The last parameter has to be an Object ID (user ID, file ID, record Id, etc): List values= ConnectApi.RecommendationActionType.values(); getRecommendationForUser(null,'xxxxxxxxx00IbK8',values[0],'follow');

objectId

Type: String Specifies the object to take action on.

  • If action is follow, objectId is a user ID, file ID, or record ID.
  • If action is join, objectId is a group ID.
  • If action is view, objectId is a user ID, file ID, group ID, record ID, or custom recommendation ID (version 34.0 and later).

I hope this answer will help you.

  • List<ConnectApi.RecommendationActionType> values= ConnectApi.RecommendationActionType.values(); 'follow'=value[0] – Dilip Aug 26 '15 at 6:46
0

Actually I was passing parameter as string for ConnectedApi.​RecommendationActionType as string it should be like

 List<ConnectApi.RecommendationActionType> values= ConnectApi.RecommendationActionType.values(); 

and pass the value as parameter like value[0] for follow...

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.