Saturday, September 23, 2023
HomeUncategorizedDelete Full Chatter Dialog Utilizing Salesforce Circulation

Delete Full Chatter Dialog Utilizing Salesforce Circulation

[ad_1]

Final Up to date on June 22, 2022 by Rakesh Gupta

Large Concept or Enduring Query:

How can customers be allowed to delete Chatter dialog?

This can be a continuation of my earlier article Delete Chatter Messages Using Salesforce Flow, In that I had mentioned a manner which permits your customers to delete Chatter messages. This text goes a step forward and explains, delete all messages without delay, i.e. delete a Chatter dialog. Chatter dialog is nothing however messages that members have despatched or obtained. 

Goals:

After studying this text, the reader will be capable of:

  • Use automation to extend consumer permissions
  • Create a customized object to retailer the Id of a Chatter dialog
  • Use Report-Triggered Circulation to delete the Chatter Dialog 

Rachel Gillett is working as a System administrator at Common Containers (UC). She has obtained a requirement from administration to permit their Gross sales reps (License Sort: – Salesforce Platform) to delete Chatter dialog from Salesforce UI.

Automation Champion Method (I-do):

**Chatter Messages performance is just obtainable in Basic

First, it is very important perceive Chatter messages and Chatter Conversations in Salesforce. Chatter messages let you’ve gotten safe non-public conversations with different Chatter customers. Use messages to ship your colleague a query privately or to speak with a number of chosen individuals when a dialogue isnt related to everybody you’re employed with. A Chatter dialog consists of messages that dialog members have despatched or obtained.  

Keep in mind the next factors for utilizing Chatter messages

  1. A personal message can embody as much as 9 members, together with your self.
  2. Messages despatched is not going to be viewable via Chatter feed, Chatter Profile, or World Search outcomes.
  3. You’ll be able to’t delete messages or conversations.
  4. An administrator with the Handle Chatter Messages permission can view and delete all customers messages in ChatterThis can be mandatory for compliance functions
    1. Messages are arduous deleted. They aren’t despatched to the Recycle Bin.
    2. Deleted messages aren’t included in message search outcomes.
    3. If all messages in a dialog are deleted, the dialog doesnt present in My Messages and mayt be retrieved through the Chatter REST API.
  5. If after studying the messages in a dialog you need to mark the dialog unread, you are able to do so solely through the Chatter REST API, not through the consumer interface.

There are a number of attainable options for the above enterprise state of affairs, however I’ll use Salesforce Circulation 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 usually are not allowed to delete messages or conversations.

In Salesforce the ChatterMessage object represents a message despatched as a part of a non-public dialog in Chatter. There are some related fields to determine:

Subject 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 Circulation at a excessive stage. Please spend a couple of minutes going via the next Circulation diagram and understanding it.

Let’s start constructing this automation course of.

Guided Follow (We-do):

There are Three steps to resolve Rachel’s enterprise requirement utilizing Report-triggered Circulation. We should:

  1. Grant handle chatter permission 
  2. Create a customized object with few fields that shall be used to avoid wasting the Id of the Chatter dialog, which the customers need to delete
  3. Salesforce Circulation Steps:
    1. Outline circulate properties for record-triggered circulate
    2. Add a call component to verify Chatter Dialog Id area just isn’t null
    3. Add a Delete Data component to delete the Chatter Dialog

Step 1: Grant Handle Chatter Messages Permission to Customers

First, create a Permission Set to grant your consumer file Handle Chatter Messages permission. In any other case, you’ll get an error whereas constructing the Circulation. The permission will be eliminated later.

Step 2: Create a Customized Object – Delete Chatter Dialog 

Create a customized object (Delete Chatter Dialog) and a textual content area to avoid wasting the Chatter Dialog Id.

  1. Click on Setup.
  2. Within the Object Supervisor, click on Create | Customized Object.
  3. Now create a customized object Delete Chatter Dialog and fields as proven within the screenshot under: 
  4. Click on Save.

Just remember to have marked the sphere Chatter_Conversation_Id__c as required and likewise granted CRUD entry to the respective profiles.

Step 3.1: Outline Circulation Properties

The subsequent step is to create a Circulation to implement the enterprise requirement, i.e. delete chatter dialog when somebody created a file within the customized object created in step #2.

  1. Click on Setup.
  2. Within the Fast Discover field, kind Flows.
  3. Choose Flows then click on on the New Circulation.
  4. Choose the Report-Triggered Circulation choice, click on on Create and configure the circulate as follows:
    1. Object: Delete Chatter Dialog
    2. Set off the Circulation When: A file is created
    3. Set Entry Standards
      1. Situation Necessities: None
    4. Optimize the Circulation For Motion and Associated Data
  5. Click on Accomplished.

Step 3.2: Utilizing Choice Factor to Verify If Chatter Dialog Id Subject is Populated or Not

The subsequent step is to verify the chatter conversation-id area is populated or not. To verify this, we are going to use the Choice component.

  1. On Circulation Designer, click on on the +icon and choose the Choice component.
  2. Enter a reputation within the Label area; the API Identify will auto-populate.
  3. Beneath Final result Particulars, enter the Label the API Identify will auto-populate.
  4. Situation Necessities to Execute Final result: All Situations Are Met (AND)
    1. Row 1:
      1. Useful resource: {!$Report.Chatter_conversation_Id__c}
      2. Operator: Is Null
      3. Worth: {!$GlobalConstant.False}
  5. Click on Accomplished.

Step 3.3: Add Motion – Delete Report

The subsequent step is to delete the chatter dialog. For this, we are going to use the Delete Data component.

  1. On Circulation Designer, under the Sure node, click on on the +icon and choose the Delete Data component.
  2. Enter a reputation within the Label area; the API Identify will auto-populate.
  3. For Tips on how to Discover Data to Delete choose Specify circumstances.
  4. Choose the ChatterMessage object from the dropdown listing.
  5. Set Filter Situations
    1. Row 1:
      1. Subject: ConversationId
      2. Operator: Equals
      3. Worth: {!$Report.Chatter_Conversation_Id__c}
  6. Click on Accomplished.

In the long run, Rachel’s Circulation will seem like the next screenshot:


As soon as all the things seems good, carry out the steps under: 

  1. Click on Save.
  2. Enter Circulation Label the API Identify will auto-populate.
  3. Click on Present Superior.
  4. API Model for Operating the Circulation: 55
  5. Interview Label: Delete Chatter Dialog {!$Circulation.CurrentDateTime}
  6. Click on Save

Virtually there! As soon as all the things seems good, click on the Activate button.  

Proof of Idea

  1. Logged in as Platform Consumer Brenda David (Customized Platform profile).Salesforce Platform User
    1. No additional permission is assigned to this consumer other than Create and Learn permission on the Delete Chatter Dialog object.
  2. Brenda needs to delete a Chatter conversations (all messages in a thread) despatched by Gross sales Consumer Rakesh Gupta, however as a enterprise consumer when she will’t run a question to get the IdChatter Conversation
  3. To get a Chatter Dialog Id, open the chatter message and right-click on it, after which choose Examine Factor, as proven within the following screenshot:Select Inspect Element for a Chatter Conversation
  4. A window will open on the backside of the present display screen. Discover and copy the Chatter Dialog Id as proven within the following screenshot:Chatter Conversation Id
  5. Create a brand new file within the Delete Chatter Dialog object, as proven within the following screenshotCreate a new record
  6. Navigate to the Chatter messages and test it out now. The dialog (i.e. test2w333?) despatched by System Administrator Rakesh Gupta will get deleted.

Final Output

Notice: – You might be solely capable of delete these Chatter conversations during 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 need to hear from you!

What’s one factor you realized from this submit? How do you envision making use of this new data in the true world? Be happy to share within the feedback under.

[ad_2]

Source link

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments