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
viswadaviswada 

Error while sending private chatter Messages from apex

 

Hi  All

 

           I want  to  send Private chatter message from apex .For that     I follwed  the code  Like  below

  

ChatterMessage cm =new ChatterMessage();
cm.body='HI This RoYal Gents Show room';
cm.ConversationId='00590000001EM7D';
cm.SenderId='00590000000bO0Y';
cm.SentDate=system.now();
insert cm;

 

 

   I  am getting errors like chatterMessage .body is not writable, chattermessage.consversationis is not writable.......

 and like this error for every field, and can't perform DML Operations  on ChatterMessages  

 

 

plz  any one help me

SFDC_EvolveSFDC_Evolve

Use this object to view and delete messages sent or received via private conversations in ChatterUsers can access this object if they have the “Manage Chatter Messages” permission. This object is provided to allow administrators to view and delete users' Chatter messages; for example, for compliance purposes.

Messages are hard deleted. They aren’t sent to the Recycle Bin.

 

 

I dont think We can insert the Reocrd of the this Object .  We need to look for  a work aroung here