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

How to create custom filter for search feed in communities

can we create filter by status create custom filters / Most Popular, Most Recent, etc.
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!!
Hi vinit,

thanks for your solution.

I didn't get Feedcomment object.I found only Feedcomment trigger.
could you please eloborate it.
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 :-