function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ericmonteericmonte 

Trending Topics Visualforce

So i created a custom visualforce page on Chatter Feeds, but it does not come with the trending topics. Is it possible to retrieve the trending topics? I don't mind creating a SOQL for it, but just need some direction on how to retrieve the topics.

 

Thanks

alouie_sfdcalouie_sfdc

You can use one of the ConnectApi.Topics.getTrendingTopics() Apex methods to retrieve the list of trending topics:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ConnectAPI_Topics_getTrendingTopics.htm

ericmonteericmonte

By any chance you can guide me on how to use this? This is my first time seeing this and not sure how it works.

Thank


ericmonteericmonte

So far i have create a method in my class with this:

 

global List <ConnectApi.Topic> getTopics(){
return null;
}

 

and unfortunately im getting a Invalid Type.

 

Also if I did this:

public static ConnectApi.TopicPage getTrendingTopics(communityId);

 

I get a unexpected token: ')'

 

alouie_sfdcalouie_sfdc
Instead of

getTrendingTopics(communityId)

you need to add the namespace and class:

ConnectApi.Topics.getTrendingTopics(communityId)
alouie_sfdcalouie_sfdc
By the way, I forgot to mention that this Apex method requires v29.0 of the API. This corresponds to Winter '14, which is currently being rolled out. Your Salesforce instance may not be on Winter '14 yet. You can check to see when you'll be getting Winter '14 on this page:

https://trust.salesforce.com/trust/maintenance/
ericmonteericmonte

awww man!!! i have a developer edition and im on na15, looks like i wont be able to use this functionality next month :(

 

Thanks alouie i'll test it out once the api 29 comes out.

alouie_sfdcalouie_sfdc
Ok, sorry about that. Let me know if you run into any issues after it's available!