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
Pim UijttewaalPim Uijttewaal 

trigger on a chatter post

Hi

I need a trigger on a chatter post, that once a chatter is posted on an account that a comment is inserted, mentioning the owner of this particular record.
I have in all honousty no idea where to start, any suggestions pls, as to code recipes etc? thx
Best Answer chosen by Pim Uijttewaal
AshwaniAshwani
Its very simple. Just write a trigger on Salesforce object named "FeedItem".

This link would help you know which fields we can leverage to process a chatter post on account: https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_feeditem.htm

On Feeditem object "ParentId" is the field where you can link the account record with the chatter post. Hope it help!

All Answers

AshwaniAshwani
Its very simple. Just write a trigger on Salesforce object named "FeedItem".

This link would help you know which fields we can leverage to process a chatter post on account: https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_feeditem.htm

On Feeditem object "ParentId" is the field where you can link the account record with the chatter post. Hope it help!
This was selected as the best answer
Pim UijttewaalPim Uijttewaal
Thanks a lot Ashwani, I'll check it out.