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
Douglas HauckDouglas Hauck 

How to set FeedElement capabilities not in CapabilitiesInput class?

Hey, all -

I am creating an Apex helper class to generate Chatter FeedElements, and I would like to allow the calling method to specify whether the element allows Likes.  According to the documentation, this is determined by whether the element Capabilities include the ChatterLikesCapability class. 

Fair enough, except that the actual FeedElementCapabilitiesInput does not contain a property for ChatterLikes, nor is there a subclass of the FeedElementCapabilitiesInput Class for ChatterLikes.  There are other capabilities that are in the Output class but not the Input class, as well.  How are these set, if not through the Input class?

Thanks,
Doug
Best Answer chosen by Douglas Hauck
ChristinaRallChristinaRall
Hi Doug,

It’s not possible to disallow likes when posting feed items. We have some feed elements like bundled posts and (I think) recommendations that can’t be liked, but we don’t allow users to toggle the ability to like on feed items.

Hope this helps,
Christina

All Answers

ChristinaRallChristinaRall
Hi Doug,

It’s not possible to disallow likes when posting feed items. We have some feed elements like bundled posts and (I think) recommendations that can’t be liked, but we don’t allow users to toggle the ability to like on feed items.

Hope this helps,
Christina
This was selected as the best answer
Douglas HauckDouglas Hauck
Thanks, Christina. 

I will mark this as the answer, but first can you tell me, is that pretty much the case for all of the Capabilities that are not available on the CapabilitiesInput class (banner, comments, emailMessage, socialPost, etc.)?  They are not available because cannot be set programmatically?
ChristinaRallChristinaRall
Yes, that's correct.
Douglas HauckDouglas Hauck
Cool.  Good to know, Christina, thanks again.
ChristinaRallChristinaRall
No problem! Always happy to help.