Sunday, September 24, 2023
HomeUncategorizedAdd Chatter Followers to File

Add Chatter Followers to File

[ad_1]

Final Up to date on March 23, 2023 by Rakesh Gupta

Massive Concept or Enduring Query:

  • How can I permit customers to simply add others as followers of a file?
  • Can I incorporate it as a part of a brand new/present Movement?

Targets:

This weblog submit will assist us to grasp the next

  • Add one other consumer as a follower of a selected file utilizing Salesforce Movement
  • Use a Determination aspect to seek out whether or not a area incorporates a price or not
  • And, final however not least, uncover learn how to use the Create Data aspect to create data
  • and rather more

Brenda David is working as a System Administrator at Gurukul on Cloud (GoC). She has obtained a requirement to develop an software that can permit customers with edit entry on the account object so as to add Chatter followers to file.

Automation Champion Method (I-do):

There are a couple of doable options for the above enterprise state of affairs. We are going to use File-Triggered Movement to resolve the requirement.

Movement will be run in System mode, bypassing the working consumer’s permissions.  For directions on learn how to accomplish this similar use case with solely Display Movement, confer with this submit: Getting Started with Salesforce Flow – Part 42 (Running a Flow in System Mode)

Earlier than continuing, it’s best to turn out to be acquainted with the EntitySubscription object in Salesforce. It represents a subscription for a consumer following a file or one other consumer. A consumer can subscribe to a file or to a different consumer.

Subject Identify Particulars
ParentId The ID of the file or consumer which the consumer is following
SubscriberId The ID of the Consumer who’s following the file or consumer

Earlier than discussing the answer, let me present you a diagram of a Course of Movement at a excessive stage. Please spend a couple of minutes to undergo the next Movement diagram and perceive it.

Let’s start constructing this automation course of.

Guided Follow (We-do):

There are 2 steps to resolve Brenda’s enterprise requirement utilizing After-Save File-Triggered Movement. We should: 

  1. Making a customized lookup area on account to retailer a brand new follower
  2. Salesforce Movement Steps:
    1. Outline movement properties for record-triggered movement
    2. Add a call aspect to examine the customized lookup area worth is just not null
    3. Add a get data aspect to seek out the standing of chosen consumer follower standing for present file
    4. Add a call aspect to examine if consumer is following the present file or not
    5. Add a create data aspect so as to add a consumer to file follower

Step 1: Making a Customized Lookup FIeld on Account Object to Retailer New Follower

  1. Click on Setup.
  2. Within the Object Supervisor, sort Account.
  3. Choose Fields & Relationships, then click on New.
  4. Choose Lookup Relationship as Knowledge Sort, then click on Subsequent.
  5. Choose Consumer as Associated To, then click on Subsequent.
  6. Enter Subject Label and click on the tab key, the Subject Identify will populate. 
  7. As a finest apply, at all times enter a description
  8. Set the Subject-level Safety for the profiles, be certain that to set this area as Seen solely. 
  9. Add this area to Web page Format.
  10. Click on Save.

Step 2.1: Outline Movement Properties

  1. Click on Setup.
  2. Within the Fast Discover field, sort Flows.
  3. Choose Flows then click on on the New Movement.
  4. Choose the File-Triggered Movement possibility, click on on Create and configure the movement as follows:
    1. Object: Account
    2. Set off the Movement When: A file is created or up to date
    3. Set Entry Standards
      1. Situation Necessities: None
    4. Optimize the Movement For Motion and Associated Data
  5. Click on Accomplished.

Step 2.2: Utilizing Determination Aspect to Examine the Customized lookup Subject Worth is Not Null

Now we’ll use the Determination aspect to examine if the customized lookup area for Consumer incorporates any worth or not.

  1. On Movement Designer, click on on the +icon and choose the Determination aspect.
  2. Enter a reputation within the Label area; the API Identify will auto-populate.
  3. Below Consequence Particulars, enter the Label the API Identify will auto-populate.
  4. Situation Necessities to Execute Consequence: All Circumstances Are Met (AND)
    1. Row 1:
      1. Useful resource: {!$File.Add_Follower__c}
      2. OperatorIs Null 
      3. Worth{!$GlobalConstant.False}
  5. When to Execute Consequence: If Provided that the file that triggered the movement to run is up to date to satisfy the situation necessities
  6. Click on Accomplished.

Step 2.3: Including a Get File Aspect to Discover Chosen Consumer Follower Standing for Present File

The subsequent step is to make use of the Get Data aspect to seek out the chosen consumer follower standing for present file.

  1. On Movement Designer, beneath the Add Follower is Not Null node, click on on the +icon and choose the Get Data aspect.
  2. Enter a reputation within the Label area; the API Identify will auto-populate.
  3. Choose the Entity Subscription object from the dropdown record.
  4. Choose All Circumstances Are Met (AND)
  5. Set Filter Circumstances
    1. Row 1:
      1. SubjectParentId
      2. Operator: Equals
      3. Worth{!$File.Id}
    2. Click on Add Situation
    3. Row 2:
      1. SubjectSubscriberId
      2. Operator: Equals
      3. Worth: {!$File.Add_Follower__c}
  6. How Many Data to Retailer:
    1. choose Solely the primary file
  7. Retailer File Knowledge:
    1. Select the choice to Robotically retailer all fields
  8. Click on Accomplished.

Step 2.4: Utilizing Determination Aspect to Examine If Chosen Consumer is Following the Present File or Not

Now we’ll use the Determination aspect to examine the File Variable from step 2.3 is null or not. 

  1. On Movement Designer, click on on the +icon and choose the Determination aspect.
  2. Enter a reputation within the Label area; the API Identify will auto-populate.
  3. Below Consequence Particulars, enter the Label the API Identify will auto-populate.
  4. Situation Necessities to Execute ConsequenceAll Circumstances Are Met (AND)
    1. Row 1:
      1. Useful resource: {!Get_Follower_Status}
      2. Operator: Is Null 
      3. Worth: {!$GlobalConstant.True}
  5. When to Execute Consequence: If the situation necessities are met.
  6. Click on Accomplished.

Step 2.5: Create Data – Add customers to the File Follower

So as to add a brand new consumer to File Follower we have to create a file within the  EntitySubscription object. For this, we’ll use the Create Data aspect. Now observe the steps beneath:

  1. On Movement Designer, beneath the No node, click on on the +icon and choose the Create Data aspect.
  2. Enter a reputation within the Label area; the API Identify will auto-populate.
  3. Enter the next data:
    1. Enter Label the API Identify will auto-populate.
    2. How Many Data to Create: One
    3. Set the File Fields: Use separate assets, and literal values
    4. ObjectEntitySubscription
    5. Set Subject Values for the EntitySubscription
    6. Row 1:
      1. Subject: ParentId
      2. Worth: {!$File.Id}
    7. Click on Add Subject
    8. Row 2:
      1. Subject: SubscriberId
      2. Worth: {!$File.Add_Follower__c}
  4. Click on Accomplished.

In the long run, Brenda’s Movement will appear like the next screenshot:

As soon as every part appears to be like good, carry out the steps beneath: 

  1. Click on Save.
  2. Enter Movement Label the API Identify will auto-populate.
  3. Click on Present Superior.
  4. API Model for Working the Movement: 57
  5. Interview Label: Add Chatter follower to file {!$Movement.CurrentDateTime}
  6. Click on Save

Virtually there! As soon as every part appears to be like good, click on the Activate button.  

Proof of Idea

  1. Log in as Brenda David (Profile assigned: – Commonplace Consumer, Drive.com Movement Consumer characteristic license is just not assigned to this consumer  ).
  2. Navigate to an account file and populate the Add Follower area with Nushi Davoud
  3. Verify the consumer has been added
    1. Log off as Brenda.
    2. Swap to Traditional
    3. Navigate to the account and evaluate the followers
  4. You might be accomplished.

Impartial Follow (We-do):

Determine use instances the place data on different objects would possibly must be shared in a extra guide manner and implement the sharing utilizing the above answer.

Formative Evaluation:

I need to hear from you!

What’s one factor you discovered from this submit? How do you envision making use of this new information in the actual world? Be at liberty to share within the feedback beneath.


[ad_2]
Source link
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments