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
Rajeev SatapathyRajeev Satapathy 

Post custom message in chatter

I want to post a custom message on behalf of the record owner when a condition is met .The message would have the object details and lookup fields present. I have to turn off standard chatter feed to post a custom message.
Any kind of code snipet or guidance ???
sharathchandra thukkanisharathchandra thukkani
Good Question..
Every object is having its respective feed object to display the feed.. since you are planning custom feed you need to design the custom object which functions same as Standard feed.
 
sharathchandra thukkanisharathchandra thukkani
we can't write triggers or do some customization on those standard feed so you need to design the custom object which behave same as standard feed. hope you got the answer.
sharathchandra thukkanisharathchandra thukkani
Hey rajeev if you want to post that in chatter feed insted of record feed. you can use FeedItem object...in order to do customize the message
sharathchandra thukkanisharathchandra thukkani
you can write trigger on feeditem object and do you customizations

trigger myFeedItem on FeedItem(before insert){
//set body of the item
for(FeedItem fi: trigger.new){
fi.Body='you message';
}
}