Last Updated on December 5, 2020 by Rakesh Gupta
How nice it would be if Salesforce auto adds a user (specified user) to Default Account Team for each new users? Well, we can cajole Salesforce to do just that by leveraging Process Builder and Visual Workflow!
An Account Team is a set of users that usually work together on an Account. A typical Account Team may include Account Manager, Sales representative, Legal advisor, etc. In Salesforce, a user can define Account Team in two places as follows:
1. Define Default Account Team on user’s record.
If a user selects Automatically add my default account team to accounts that I create or accounts that are transferred to me checkbox then Salesforce will auto add Default Account team members to new account.
2. Manually add the members to Account Team for each new account records.
Once a new user is successful logged into Salesforce, the next task is for them to set up preferences for email and adding members to Default Account and Opportunity Teams. Although organizations have onboarding training for new users, at times, a user may miss setting up critical settings. If so then, why not leverage Process Builder and/or Visual Workflow to avoid such mishaps? Let us see how to get started on working smarter by tackling a business use case.
Business Use Case
Martin Jones is working as a System Administrator at Gurukul on Cloud (GoC). At GoC they use Account Team to easily track collaboration on Accounts. They have a Legal Advisor (Sarika Gupta) who helps them on legal side for all deals. Martin has received two requirements from the higher management:
- Add Sarika Gupta, a Legal Advisor, to the Default Account Team, on the new user’s record. So that, when an account owner clicks on Add Default Team (Using button available on the Account Team related list) or selects Automatically add my default account team to accounts that I create or accounts that are transferred to me checkbox, it will add Default Account Team members to Account Team on an account record.
- Add Sarika Gupta as Legal Advisor to all new accounts (This would work in cases where a user does not select Automatically add my default account team to accounts that I create or accounts that are transferred to me checkbox). Blog 81
They wanted to grant following access to legal Advisor as stated below:
Account:- Read
Contact :- Read
Case:- Private
Opportunity:- Read
Solution for the above business requirement
I am going to discuss the first requirement in this blog post. For the second requirement, please check out my next article Getting Started with Process Builder – Part 81.
There are a few possible solutions for the above business scenario, but we’ll use Flow and Process Builder to solve the above business requirement. Before trying to understand the technical aspect of the solution, let us spend some time to understand the general flow at a high level. Please spend few minutes to go through the following flow diagram and understand it.
Before we proceed further, let us understand the characteristics of UserAccountTeamMember object – It represents a User on the default account team of another User.
Field Name | Details |
UserId | ID of the User who is a member of the default account team |
OwnerId | ID of the User who owns the default account team |
TeamMemberRole | Role that the team member has on opportunities for which the user has added his or her default account team |
AccountAccessLevel/CaseAccessLevel/
ContactAccessLevel/OpportunityAccessLevel |
Set Access level for account, case, contact and opportunity objects. |
- First of all, we will create a new Custom Label to store the Legal Advisor user’s ID (i.e. user Sarika Gupta’s ID). If you wanted to add multiple users then, you must use the Visual Workflow approach that I am going to discuss on the next blog i.e. Getting Started with Process Builder – Part 81.
- To create a custom label click on Setup (Gear Icon) | Setup | User Interface | Custom Labels
- The next step is to create a Flow, by clicking on Setup (Gear Icon) | Setup | Process Automation | Flows
- Click on New Flow, it will open flow canvas for you.
- To access custom label in flow, you must create a formula. Create one formula For_LegalAdvisorID, as shown in the following screenshot:
- Also create one Text variable to store new user id, as shown in the following screenshot:
- To add a member to Default Account Team for new users, drag and drop a Record Create ( Give the name Add Default Account Team Member) onto the window and map the fields as shown below:
- Finally, your flow should look like as follows:
- Once you are done, Save the flow with the name (Add Member to Default Account Team) with Type: Autolaunched Flow. Don’t forget to activate the Flow by clicking on the Activate button.
- The next step is to create a process, that will fire when a new user gets created. To do this, Navigate to Setup (Gear Icon) | Setup | Process Automation | Process Builder
- To create a new process from scratch, click on the New Button available on Process Management page. A popup will appear where you have to enter the Name (Use Auto add a member to Default Account Team as the name), API Name and Description as shown in the screenshot below:
- Once you are done, click on the Save button.
- Click on the Object node to add object and then select the User object. For the entry criteria, select only when a record is created, as shown in the screenshot below:
- Once you are done, click on the Save button.
- The next task is to add Process Criteria, so that process will only fire when a user is created and it’s active. To do this click on Add Criteria, enter Name, Type of action and set filter conditions, and follow the instructions below
- Once you are done, click on the Save button.
- Now we have to add an Immediate action into the Process to add Sarika Gupta to Default Account Team for new users. Click on Add Action (Under Immediate actions), Select the type of action (In our case Flows), and then fill the values into fields to define the action – as shown in the following screenshot:
- Once you are done, click on the Save button.
- In the end, your Process will look like the following screenshot:
- Do not forget to activate the Process by clicking on the Activate button.
It’s time to test this feature
Next time, when a User is created by the system administrator, the process we created ( Using Process Builder) will fire and add Sarika Gupta, to the User’s Default Account Team.
In my next blog, I will take a deeper dive and show you how you can add multiple users to every account record (when Automatically add my default account team to accounts that I create or accounts that are transferred to me checkbox is not selected) under Account Team – this is the requirement #2 that our tireless System Administrator, Martin Jones, will be working on next!
Technical Editor and Proofreader: - Munira Majmunda
2 thoughts on “Getting Started with Process Builder – Part 80 (Auto Add Member to New User’s Default Account Team)”
Frederic Bellenger
Great article that gives a better idea of what we can do with Flow.
Rakesh Gupta
Great! Thanks for the feedback