[ad_1]
Final Up to date on June 22, 2022 by Rakesh Gupta
Massive Thought or Enduring Query:
How can customers be allowed to delete particular person Chatter messages?
Targets:
After studying this text, the reader will have the ability to:
- Use automation to extend person permissions
- Create a customized object to retailer the Id of a Chatter message
- Use Report-Triggered Stream to delete the Chatter Message
Rachel Gillett is working as a System administrator at Common Containers (UC). She has acquired a requirement from administration to permit their Gross sales reps (License Sort: – Salesforce Platform) to delete Chatter messages one-by-one from the Salesforce UI.
Automation Champion Strategy (I-do):
**Chatter Messages performance is simply out there in Traditional
First, it is very important perceive Chatter messages and Chatter Conversations in Salesforce. Chatter messages let you might have safe non-public conversations with different Chatter customers. Use messages to ship your colleague a query privately or to speak with just a few chosen individuals when a dialogue isn‘t related to everybody you’re employed with. A Chatter dialog consists of messages that dialog members have despatched or acquired.
Bear in mind the next factors for utilizing Chatter messages
- A personal message can embody as much as 9 members, together with your self.
- Messages despatched won’t be viewable via Chatter feed, Chatter Profile, or World Search outcomes.
- You possibly can’t delete messages or conversations.
- An administrator with the Handle Chatter Messages permission can view and delete all customers‘ messages in Chatter. This can be needed for compliance functions
- Messages are arduous deleted. They aren’t despatched to the Recycle Bin.
- Deleted messages aren’t included in message search outcomes.
- If all messages in a dialog are deleted, the dialog doesn‘t present in My Messages and might’t be retrieved through the Chatter REST API.
- If after studying the messages in a dialog you wish to mark the dialog unread, you are able to do so solely through the Chatter REST API, not through the person interface.
There are just a few attainable options for the above enterprise state of affairs, however I’ll use Salesforce Stream and Customized Object to resolve the enterprise requirement. As mentioned earlier, a System Administrator with the Handle Chatter Messages permission can view and delete all customers’ messages in Chatter. Enterprise customers aren’t allowed to delete messages or conversations.
In Salesforce the ChatterMessage object represents a message despatched as a part of a personal dialog in Chatter. There are some related fields to establish:
Area Identify | Particulars |
Id | Chatter Message Id |
ConversationId | The ID of the dialog that the ChatterMessage is related to. |
Earlier than discussing the answer, let me present you a diagram of a Course of Stream at a excessive degree. Please spend a couple of minutes going via the next Stream diagram and understanding it.
Let’s start constructing this automation course of.
Guided Apply (We-do):
There are Three steps to resolve Rachel’s enterprise requirement utilizing Report-triggered Stream. We should:
- Grant handle chatter permission
- Create a customized object with few fields that might be used to avoid wasting the Id of the Chatter message, which the customers wish to delete
- Salesforce Stream Steps:
- Outline movement properties for record-triggered movement
- Add a call factor to test Chatter Message Id area will not be null
- Add a Delete Information factor to delete the Chatter Message
Step 1: Grant Handle Chatter Messages Permission to Customers
First, create a Permission Set to grant your person report Handle Chatter Messages permission. In any other case, you’ll get an error whereas constructing the Stream. The permission will be eliminated later.
Step 2: Create a Customized Object – Delete Chatter Messages
Create a customized object (Delete Chatter Message) and a textual content area to avoid wasting the Chatter MessageId.
- Click on Setup.
- Within the Object Supervisor, click on Create | Customized Object.
- Now create a customized object Delete Chatter Message and fields as proven within the screenshot beneath:
- Click on Save.
Just remember to have marked the sector Chatter_Message_Id__c as required and likewise granted CRUD entry to the respective profiles.
Step 3.1: Outline Stream Properties
The following step is to create a Stream to implement the enterprise requirement, i.e. delete chatter message when somebody created a report within the customized object created in step #2.
- Click on Setup.
- Within the Fast Discover field, kind Flows.
- Choose Flows then click on on the New Stream.
- Choose the Report-Triggered Streampossibility, click on on Create and configure the movement as follows:
- Object: Delete Chatter Message
- Set off the Stream When: A report is created
- Set Entry Standards
- Situation Necessities: None
- Optimize the Stream For Motion and Associated Information
- Click on Carried out.
Step 3.2: Utilizing Choice Aspect to Test If Chatter Message Id Area is Populated or Not
The following step is to test the chatter message-id area is populated or not. To test this, we are going to use the Choice factor.
- On Stream Designer, click on on the +icon and choose the Choice factor.
- Enter a reputation within the Label area; the API Identify will auto-populate.
- Beneath Consequence Particulars, enter the Label the API Identify will auto-populate.
- Situation Necessities to Execute Consequence: All Situations Are Met (AND)
- Row 1:
- Useful resource: {!$Report.Chatter_Message_Id__c}
- Operator: Is Null
- Worth: {!$GlobalConstant.False}
- Row 1:
- Click on Carried out.
Step 3.3: Add Motion – Delete Information
The following step is to delete the chatter message. For this, we are going to use the Delete Information factor.
- On Stream Designer, beneath the Sure node, click on on the +icon and choose the Delete Information factor.
- Enter a reputation within the Label area; the API Identify will auto-populate.
- For Find out how to Discover Information to Delete choose Specify circumstances.
- Choose the ChatterMessage object from the dropdown checklist.
- Set Filter Situations
- Row 1:
- Area: Id
- Operator: Equals
- Worth: {!$Report.Chatter_Message_Id__c}
- Row 1:
- Click on Carried out.
In the long run, Rachel’s Stream will appear like the next screenshot:
As soon as every thing appears to be like good, carry out the steps beneath:
- Click on Save.
- Enter Stream Label the API Identify will auto-populate.
- Click on Present Superior.
- API Model for Working the Stream: 55
- Interview Label: Delete Chatter Messages {!$Stream.CurrentDateTime}
- Click on Save.
Nearly there! As soon as every thing appears to be like good, click on the Activate button.
Proof of Idea
- Logged in as Platform Person Brenda David (Customized Platform profile).
- No further permission is assigned to this person other than Create and Learn permission on the Delete Chatter Message object.
- Brenda needs to delete a Chatter Message despatched by Gross sales Person Rakesh Gupta, however as a enterprise person when she will be able to’t run a question to get the Id
- To get a Chatter Message Id, open the chatter message and right-click on it, after which choose Examine Aspect, as proven within the following screenshot
- A window will open on the backside of the present display screen. Discover and copy the Chatter Message Id as proven within the following screenshot
- Create a brand new report within the Delete Chatter Message object, as proven within the following screenshot
- Navigate to the Chatter messages and test it out now. The message (i.e. What’s up?) despatched by System Administrator Rakesh Gupta will get deleted.
Be aware: – You’re solely in a position to delete these Chatter messages by which you might be included, in any other case you’ll get an error. (There’s nothing in Salesforce matching your delete standards). It’s not relevant to the system administrator with the Handle Chatter Messages permission.
Formative Evaluation:
I wish to hear from you!
What’s one factor you realized from this submit? How do you envision making use of this new information in the true world? Be happy to share within the feedback beneath.
[ad_2]
Source link