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
Kishan TrambadiyaKishan Trambadiya 

where i have to moniter a chat for chatter messenger??

I want to use the fields of the chatter message object. so i made an instance of chatter message but then where i have to make a trigger for chatter messenge??

//list
public List<ChatterMessage> filterChatterMessage(List<ChatterMessage> cm)
    {
        system.debug('filterChatterMessage:'+cm);
        return filterBody(fm);
    }

public List<SObject> filterBody(List<SObject> sobjs)
     {
     for (SOBject feedObject: sobjs)
     {
           
     if(feedObject instanceOf ChatterMessage)
     {
       body = ((ChatterMessage)feedObject).Body;
       ConversationId = ((ChatterMessage)feedObject).ConversationId;
       SenderId = ((ChatterMessage)feedObject).SenderId;                
       SentDate = ((ChatterMessage)feedObject).SentDate;
                
     }
     else
     {
      ........
      }

so where i have to make a trigger for chatter message??
            

Jia HuJia Hu
Based on my understanding, ChatterMessage object doesn't support Trigger.
It is only used for read/delete private message by Apex or SOAP API.
You can create a private message by Chatter REST API.