I have read some other items on this list that are somewhat the same question as I am about to pose but not exactly - I apologize if this is a duplicate.

I was experimenting with Chatter in our development org and just using Chatter settings (in Setup - Customize - Chatter) I was able to set it so that when you change a lookup field setting on my custom object you get a chatter feed that indicates what the old and new lookup values were related to the change.

An example of the chatter is shown below:

enter image description here

The words 'Samples' and 'Service Loaners' are links to custom objects so if you click on them you go directly to that record in the standard salesforce fashion.

I have a process (APEX) that writes some chatter that is posted to either an Account, Contact, Opportunity or User object but that mentions my custom object in the text of the chatter (e.g. "Assigned Equipment (MyEquipmentName) on (DateOfAssignment)").

Can anyone tell me how I could write a chatter feed item that contains hyperlinks to a my custom object so that someone could click (MyEquipmentName) and be taken to the custom object?

1 Answer 1


I believe you're lookin for a way to post chatter mentions. You can't currently post chatter mentions without making use of the chatter rest Api

Here's the solution to a similar question that was asked - this should let you post mentions How can I add an @mention when creating a FeedItem via APEX?

  • Thank you very much. While I actually cannot get the code in the other post to work for me that doesn't matter - the question I asked is answered :-)
    – AngiB
    Commented Oct 19, 2012 at 13:52
  • Hey Angi, the code I've pasted there is from something I've written and gotten it to work. Please let me know how I can help. Commented Oct 19, 2012 at 14:13
  • It's been a long week and right now I have several projects on the go so I decided to revert back to the non-hyperlinked (pure Apex) chatter feed postings for the moment. Once my workload comes back down I think I will take another look at the problem.
    – AngiB
    Commented Oct 19, 2012 at 14:54
  • You can only mention user or group. That's what I get from API: "ConnectApi.ConnectApiException: Only user and group IDs may be used in inline mentions."
    – Mike Raven
    Commented Aug 24, 2015 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .