To understand how to solve a similar business use case using Process Builder. Check out this article Getting Started with Process Builder – Part 29 (Auto Remove Followers From Questions With Best Replies).
Big Idea or Enduring Question:
How do you automatically remove followers from closed opportunities?
In Salesforce a user can follow Chatter groups or Records. The chatter group manager can add or remove users to the group, for this Salesforce provides out-of-the-box functionality. To manage Follower on the record Salesforce does not have any inbuilt functionality, for example, a rule to auto Add or remove users to records.
On Chatter, a user can follow a maximum of 500 Peoples, topics, and records. To effectively manage Chatter, an organization has to use some automation to auto-unfollow records. If you want to increase this limit log a support case with Salesforce support.
After reading this article, the reader will be able to:
- Use After-save Record-Triggered Flow to remove the followers from closed opportunities
- Use After-save Record-Triggered Flow Delete element to delete the record(s)
- Use a Decision element to find – record variable or record collection variable contains a record or not
Business Use case
Steven Greene is working as a System Administrator at Universal Containers (UC). He has received a new requirement to auto-remove the followers from closed opportunities.
Automation Champion Approach (I-do):
While this can be solved using various automation tools like Apex or Flow, we will use After-save Record-Triggered Flow. Check out this article to understand why we are using after-save record-triggered flow for this scenario.
Before proceeding ahead, you have to understand EntitySubscription objects in Salesforce. It represents a subscription for a user following a record or another user.
|ParentId||The Id of the record or user which the user is following|
|SubscriberId||The Id of the User who is following the record or user|
Before discussing the solution, 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.