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
TanmayBharatTanmayBharat 

Trigger On Chatter

Can any body guide how to write a trigger on Chatter. That should fire when in Chatter I send a message to some of the specific users in a group. And based on that an approval process should start to get the approval from the same users.

 

Another part of this exercise is I need to send one doc to each of these users for review and they will send it back to me on approving/reviewing the same. But for this part I feel sharing doc using Chatter should serve my purpose and  that should be the best way.

 

This is not a part of any application. Being salesforce users, it is just to use Chatter for our daily task in office and to reduce the burden of doing the same job separately. The main idea is to combine Chatter with approval proceess/workflow using a Trigger.

 

Thanks

cloudcodercloudcoder

Triggers on Chatter are either on the FeedItem, FeedComment or User object (for user status updates).

 

Few things to remember about Chatter triggers:

 

1. They don’t support before update, after update, or after undelete

2. Triggers execute on 'generic' FeedItems. You should use Type or Entity prefixes to limit their execution

3. addErrors('my message') is a great way of handling instant user feedback.

 

You might want to check out the recent Chatter Tips and Tricks webinar which covers Chatter Triggers:

 

http://wiki.developerforce.com/index.php/Webinar:_Build_Social_Apps_With_Chatter