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
@GM@GM 

How to create custom filter for search feed in communities

can we create filter by status updates.to create custom filters / Most Popular, Most Recent, etc.
Vinit_KumarVinit_Kumar
You should query on Feedcomment object and filter by CreatedDate to get the Most Recent Feeds.So,your Query should look like below :-

SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body FROM FeedItem WHERE CreatedDate > LAST_MONTH ORDER BY CreatedDate DESC, Id DESC

Not sure how you are calculating the Most Popular Feeds,do you have any field or something to calculate the same.

Hope this helps!!
@GM@GM
Hi vinit,

thanks for your solution.

I didn't get Feedcomment object.I found only Feedcomment trigger.
could you please eloborate it.
Vinit_KumarVinit_Kumar
I don't understand what you meant by 'didn't get Feedcomment object.I found only Feedcomment trigger.'.This is the same object and it provides triggerable interface.

Please go through below link to learn more :-

https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_feedcomment.htm