Big Idea or Enduring Question:
How can users be allowed to delete Chatter conversation?
This is a continuation of my previous article Getting Started with Process Builder – Part 35 (Delete Chatter Messages), In that I had discussed a way which allows your users to delete Chatter messages. This article goes a step ahead and explains, how to delete all messages at once, i.e. how to delete a Chatter conversation. Chatter conversation is nothing but messages that members have sent or received.
After reading this article, the reader will be able to:
- Launch a flow from Process Builder
- Use automation to increase user permissions
- Create a custom object to store the Id of a Chatter conversation
- Use Flow to delete the Chatter Conversation
Business Use case
Rachel Gillett is working as a System administrator at Universal Containers (UC). She has received a requirement from management to allow their Sales reps (License Type: – Salesforce Platform) to delete Chatter conversation from Salesforce UI.
Automation Champion Approach (I-do):
**Chatter Messages functionality is only available in Classic
First, it is important to understand Chatter messages and Chatter Conversations in Salesforce. Chatter messages let you have secure private conversations with other Chatter users. Use messages to send your colleague a question privately or to communicate with a few selected people when a discussion isn‘t relevant to everyone you work with. A Chatter conversation consists of messages that conversation members have sent or received.
Remember the following points for using Chatter messages
- A private message can include up to 9 members, including yourself.
- Messages sent will not be viewable through Chatter feed, Chatter Profile, or Global Search results.
- You can’t delete messages or conversations.
- An administrator with the Manage Chatter Messages permission can view and delete all users‘ messages in Chatter. This may be necessary for compliance purposes
- Messages are hard deleted. They aren’t sent to the Recycle Bin.
- Deleted messages aren’t included in message search results.
- If all messages in a conversation are deleted, the conversation doesn‘t show in My Messages and can’t be retrieved via the Chatter REST API.
- If after reading the messages in a conversation you want to mark the conversation unread, you can do so only via the Chatter REST API, not via the user interface.
There are a few possible solutions for the above business scenario, but I’ll use Process Builder and Flow to solve the business requirement. As discussed earlier, a System Administrator with the Manage Chatter Messages permission can view and delete all users’ messages in Chatter. Business users are not allowed to delete messages or conversations.
In Salesforce the ChatterMessage object represents a message sent as part of a private conversation in Chatter. There are some relevant fields to identify:
|Id||Chatter Message Id|
|ConversationId||The ID of the conversation that the ChatterMessage is associated with.|
Before discussing it, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.