2

Unfortunately SFDC decided to not make the relevant triggers fire when you like a Chatter post. It also doesn't fire if someone comments on a Chatter post (the FeedItem object has both a LikeCount and a CommentCount field that are being updated).

If we want to do something when these events occur, what our are best options? For comments I suppose we can hook in to the FeedComment trigger and fire something off of the parent, but I can't really think of anything that can be done for likes on posts or comments.

  • 1
    Insert a bit of JQuery into a sidebar component, which binds to the Like links, and on click invokes some controller code possibly via JS Remoting? There is always the option of Visualforcing the Chatter tab I guess. – techtrekker Oct 30 '12 at 17:39
  • Yeah, that's what I've been working on doing. You should add this as an answer. – Ryan Elkins Oct 30 '12 at 17:55
1

(This is not so much a definite answer, but an approach)

There is always the option of Visualforcing the Chatter tab I guess.

The other option would be to Insert a bit of JQuery into a sidebar component, which binds to the Like links, and on click invokes some code via the AJAX Toolkit or the REST API. (From what I've read you can't do JS Remoting without involving Visualforce)

$("#clicked_link").click(function(){ //Invoke AJAX Toolkit });

Intrestingly, here's the view source of the Like link : Like

THere's a Chatter JS Library at /jslibrary/1349737722000/sfdc/Chatter.js , which should make for some interesting reading to check if it can be leveraged to invoke a bit of custom code.

| improve this answer | |
  • I'm taking this approach right now. The HTML isn't set up in a way that makes it really easy - for example, the item Id is really only present as a parameter in the existing JS so it has to be parsed out which is a little clumsy. – Ryan Elkins Oct 30 '12 at 18:48

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.