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
michael_hymichael_hy 

Chatter message history

Hello guys

I want to use Apex code to search the chatter history.

I find a standard object "ChatterMessage " at below link, but when I get some search it has an error.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_chattermessage.htm

And I'm also unable to edit the  "Manage Chatter Messagespermission on my System Administrator profile, should this be so? Could anybody can help me about this?

 

String userid='00590000000laxMAAQ';
String str = 'SELECT Body, ConversationId, SentDate FROM ChatterMessage WHERE SenderId= :userid';
LIST<SObject> L = Database.query(str);

 

 

EXCEPTION: System.QueryException: sObject type 'ChatterMessage' is not supported.
STACKTRACE: AnonymousBlock: line 3, column 1
LINE: 3 COLUMN: 1

 


Best Answer chosen by Admin (Salesforce Developers) 
michael_hymichael_hy

this object need to have the “Manage Chatter Messages” permission.