Skip to main content
I need to retrieve the direct messages sent to a community user using Apex. I found that direct messages stores under "ChatterMessage" Object.

 

After enabling the system permissions "Manage Chatter Messages and Direct Messages", I am able to do the SOQL on the "ChatterMessage" SObject using Developer Console. But still, it's returning 0 records however I made a couple of direct message at my private community.

 

Appreciate your inputs.
2 个回答
  1. 2020年5月4日 23:24
    Hi Sunil,

     

    What was your query? Something like this --

     

    SELECT Body,ConversationId,Id,SenderId,SentDate FROM ChatterMessage

     

    Are you a system admin in the org? Also, isnt this a provacy concerns?

     

    Thank you!

     

    Arun S.
0/9000