Automation Champion

Automating Salesforce One Click at a Time
Automation Champion
  • Home
  • About Me
    • Testimonials
    • Resources
  • Process Builder
  • Salesforce Flow
  • Pardot
  • Apex
  • Training Details
    • Salesforce Administrator
    • Salesforce Advanced Administrator
    • Platform App Builder
    • Lightning Flow
    • Pardot
    • Sales Cloud
    • Service Cloud
    • Community Cloud
    • Hands-on Excercises
  • My Books
  • Contact Me
  • Tag: Flow Triggers For Workflow

    • Getting Started with Salesforce Flow – Part 50 (Welcome New Users by Default – Auto Follow them in Chatter!)

      Posted at 9:00 AM by Rakesh Gupta, on January 7, 2021

      Big Idea or Enduring Question:

      A warm welcome goes a long way in solidifying a company’s culture! If so then, why not provide existing users an ability to auto-follow new users in chatter?

      Chatter is a great way to boost collaboration in your organization. You can Post Status, Links, Files, and Comments on others’ posts, etc. The benefits of following the new users in Chatter are the following:

      1. Keep up with what new users are doing; your guidance will expedite, and streamline their on-boarding journey!
      2. Following new users will enable you to track their chatter activities; use this ‘crystal ball’ to help them to improve their productivity!

      In the past, I have written a few articles related to User, Chatter, and automation. Why not check them out while you are at it?! 

        1. Getting Started with Salesforce Flow – Part 26 (Automatically Add a Record to Chatter Group)
        2. Getting Started with Salesforce Flow – Part 37 (Auto Remove Followers From Closed Opportunity)
        3. Getting Started with Salesforce Flow – Part 36 (Automatically Add New Users to a Chatter Group)
        4. Getting Started with Salesforce Flow – Part 30 (Reminder Email to Upload Chatter Profile Photo)

      On the Trailblazer community, several people have been wondering how to allow their users to auto-follow new users. Salesforce doesn’t have any out-of-the-box feature for this; so, I decided to take a crack at it. This article shows how to develop an app that allows your users to auto-follow news users without code.

      Objectives:

      After reading this blog post, the reader will be able to:

      • What is a MIXED DML error and how to avoid it?
      • Add a Time-dependent action in After-save Record-Triggered Flow
      • Get the list of user who has opted to follow new users in Chatter  
      • Use a Loop element to work with multiple records 
      • Use After-save Record-Triggered Flow to create a record (Bulk Safe)
      • Monitor Time-based flow queue

      Business Use Case

      Warren Mason, Gurukul on Cloud‘s (GoC) awesome System Administrator, received the following requirement – allow users to auto-follow new users in Chatter. And, make this an optional feature. 

      Automation Champion Approach (I-do):

      While this can be solved using various automation tools like Apex, etc, but we’ll use After-save Record-Triggered Flow to solve it. 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 the EntitySubscription object. The object represents a user‘s subscription – whether the user follows a record or other users.

      Field Name Details
      SubscriberId The Id of the User who is following the record or user.
      ParentId The Id of the record or user which the user is following.

      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.

      Let’s begin building this automation process.

      Guided Practice (We-do):

      There are 2 steps to solve Warren’s business requirement using After-save Record-Triggered Flow. We must: Read the rest of this entry!

      Posted in Chatter, Salesforce Flow, Schedule-Triggered Flow, User Management | 16 Comments | Tagged Advance flow, After save flow, Auto, Auto Follow and Auto Unfollow records based on Criteria, Auto follow Chatter user, Auto follow Chatter users, Auto follow new user, Auto follow new user in Salesforce, Auto follow new users, Auto follow new users in Salesforce, Auto follow user, Bulkify flow, Chatter, Cloud Flow, Collection variable, EntitySubscription, EntitySubscription object, Fast lookup, flow, flow builder in salesforce, flow builders, Flow bulkification, Flow Designer, Flow exmple, Flow triggers, Flow Triggers For Workflow, Flow varibale, FlowRockstar, Follow new user in Salesforce, Follow new users in Salesforce, Follow user in Chatter, Lightning Flow, Lightning Flow example, lightning flows in salesforce, Loop Logic, New Flow, sales force automation software, salesforce automation, salesforce automation tools, Salesforce Flow, Salesforce Flow Example, salesforce flows, salesforce lightning flow, salesforce lightning flow examples
    • Auto Add/Remove Permission Set – Part 2

      Posted at 4:26 PM by Rakesh Gupta, on August 14, 2014

      In the last article Auto Add/Remove Permission Set – Part 1 I have gone through the way to automate Assign Permission Sets process based on user defined criteria. In this article I will discuss a way to automate Unassign Permission Sets based on criteria.

      Business Use Case

      Management in Universal Container wants to automate permission set removal or Unassigned process so that their admin workload will be reduced.

      Solution for the above business requirement

      In this article, I will discuss how to auto Unassign/Remove Permission Sets from the user. First of all, create few fields on the User object to save condition to auto Unassign/Remove Permission Sets to the user. In this demo, I will create a few fields on the User object as shown in the below screenshot

      Custom Fields on User object

      Custom Fields on User object

      To solve this requirement we will use Visual Workflow and Workflow Rule (i.e Headless Flow).  Before going ahead with the solution you have to understand about PermissionSetAssignment Object. It represents the association between a User and a Permission Set. Below are the key fields from PermissionSetAssignment object

      Field Name Details
      PermissionSetId ID of the PermissionSet to assign to the user specified in AssigneeId.
      AssigneeId ID of the User to assign the permission set specified in PermissionSetId.

      To develop this application follow the below instructions

      1) Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows
      2) Click on New Flow, it will open flow canvas for you. Create Two Text type variable UserID (To pass User ID) and RemovalPermissionsetID (To pass  ID  of permission set which system admin want to remove from user)
      3) Drag and drop a Record Delete ( Give the name Delete Permission Set) onto the window to assign permission set to user and map the fields according to below details

      • Select Object PermissionSetAssignment
      • AssigneeId=  {!UserId}
      • PermissionSetId= {!RemovalPermissionSetID}, You can take help from the following screenshot
      Remove Permission Set

      Remove Permission Set

      4) Finally, our Flow will look like the following screenshot

      Remove Permission Set

      8) Save the flow with name Remove Permission Set and close the canvas.

      Create Workflow rule to fire our Flow

      Our next task is to create a workflow on the User object on the creation and every time it’s edited event. To create a workflow on the User object follow the below instructions

      1) Click on Name | Setup | App Setup | Create | Workflows & Approvals | New Rule
      2) Select object  User from the drop-down
      3) Enter Name, for Evaluate criteria  select Created, and any time it’s edited to subsequently meet criteria ( To create a time-dependent workflow), For Rule Criteria select End Date != False  and  Remove = False as shown in the following screenshot

      Workflow Rule1

      Workflow Rule1

      4) Now Add a time trigger to set Remove flag True after 0hr of End Date. To do this click on Add Time Trigger button and Set the length after how many days/hours workflow will fire  i.e.  in hours and days, I selected 0hr after the End Date. Now add one field update action for time-dependent workflow and set Remove flag to True. You can take help from the following screenshot

      Time based action

      Time-based action

      5) Save the workflow and activate it.
      6) Create another workflow (i.e. workflow Rule2 ) on the same object to fire our Flow, set entry criteria of trigger is Remove = True

      Workflow Rule2

      Workflow Rule2

      7) Add one Immediate Workflow Actions i.e. New Flow Trigger and Select Flow (Remove Permission Set) and set Variable (UserID and RemovalPermissionsetID ) value as shown in the following screenshot

      New Flow Trigger Action

      New Flow Trigger Action

      8) Add one Immediate Workflow Actions i.e. New Field Update and Set Remove flag to False.
      9) Save the workflow and activate it.

      It’s time to test this feature

      1) Go to the User’s detail page to whom you want to Unassign Permission Sets and fill the detail. In this demo I am going to Unassign Permission Sets with Name “Test“,  it will look similar to below screenshot

      Permission Set Removal Detail

      Permission Set Removal Detail

      2) To check time-dependent workflow queue Follow the path, Click on Name | Setup | Administration Setup | Monitoring | Time–Based Workflow and search the queue

      Time-Based Workflow Queue

      Time-Based Workflow Queue

      Note: -I will suggest you Implement this first on your developer org test it and then move it to Production. Let me know if you have any difficulty to Implement it.

      Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

      Posted in Salesforce Flow, User Management | 0 Comments | Tagged ADM 201, adm 201 certification, adm 201 salesforce, Advance flow, Auto Add/Remove Permission Set, auto remove Permission Set, Auto remove permission set based on date, auto remove permission set from user, Auto remove Permission Sets in Salesforce, Auto revoke permission set access, Auto revoke permission set on future date, auto Unassign Permission Set, auto unassign permission set based on date, Cloud Flow, Cloud Flow Designer Workbook, Con 201, dev 401, DEV401, flow, Flow Designer, Flow examples, Flow exmple, Flow Triggers For Workflow, FlowRockstar, FlowTrigger, FlowTriggerPilot, FlowX Flow Triggers, headless flow, Headless Flows, New Flow, PermissionSetAssignment, PermissionSetId, Record Create, remove permission set, Remove permission set based on date, Remove permission set from user, remove permission set in future, remove permission sets, Revoke permission set access, Salesforce Flow, Screen, screenshot, Sp14FlowHackathon, Trigger Flow, Trigger ready flow, Unassign Permission Set, Visual flow, Visual Work Flow, Visual workflow, Visual workFlow examples, Visual Workflow Flow Cloud Flow Designer, Visual Workflow Implementation Guide, workflow rule
    ← Older posts
    • Search

    • Upcoming Trainings

      Salesforce Administrator Certification
      Salesforce Advanced Administrator Certification
      Salesforce Platform App Builder Certification
      Lightning Flow & Process Builder
      Advanced Lightning Flow
      Pardot Specialist & Consultant Certification
      Sales Cloud Consultant Certification
      Service Cloud Consultant Certification
      Community Cloud Consultant Certification
    • Sponsor #1

    • Sponsor #2

    • Sponsor #3

    • Sponsor #4

    • Order Now!

    • Buy My Book

    • Buy My Book

    • Recent Posts

      • Getting Started with Salesforce Flow – Part 59 (Clone a Chatter Group with Members)
      • New Research: Salesforce Delivery Teams Excel in Speed but at the Expense of Quality
      • Improve Your Data Collection Strategy with Web Forms
      • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
      • Advancing Business Operations with Salesforce and QuickBooks
    • Salesforce ID Converter Build on Lightning Flow

      Converting 15 digit ID to 18 digit Salesforce ID
    • Blog Archives

    • Categories

  • Information

    • About Me
    • Affiliate Disclaimer
    • Contact Me
    • Privacy Policy
  • Top Posts

    • Learning Flow
    • Learning Process Builder
    • Getting Started with Salesforce Flow – Part 43 (Dynamic Approval Routing in Salesforce)
    • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
    • Getting Started with Salesforce Flow – Part 11 (Count Number of records in a Record Collection Variable)
    • Getting Started with Salesforce Flow – Part 59 (Clone a Chatter Group with Members)
    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
    • Salesforce Spring’21 Release Quick Summary
    • Getting Started with Salesforce Flow – Part 1 (Understand, Create & Use Variables in Flow!)
    • Getting Started with Salesforce Flow – Part 31 (Auto Submit Record into Approval Process with Flow)
  • Social Media

    • View Automationchampion’s profile on Facebook
    • View Automationchamp’s profile on Twitter
    • View Rakeshistom’s profile on GitHub