How to manage OOO Coverage? - Solution #1
- Kriss Lugo
- May 11, 2021
- 2 min read
Someone in the Salesforce community recently asked about OOO Coverage. What should you do when someone goes on vacation? Are they allow to take vacation? really?!... Whom will cover for them? For how long? Do I need to manually update each record?
So, thinking about it I got some solutions that I'll be covering through different posts.
Case: You are the System Admin at Finishing Rope Inc. The sales Manager notified you that a sales rep is going on a 3 weeks vacation and he needs someone to cover for them. The manager give you a date and ask you to give that user read and write access to the opportunities owned by the lucky guy on vacation.
So, we are assuming that your OWD is private for Opportunities and that you have Opportunity Teams enabled.
Before we dig into flows, add a new opportunity team member role called: "OOO Coverage"
Now let's create our flow:
SCREEN #1: Let's specify the action to be taken
Add a new user to the Opportunity Team
Remove user from the Opportunity Team
We will add a Picklist or Radio button (Whichever you prefer) and add 2 options; called: "Select Action"
Add a new user to the Opportunity Team (true)
Remove user from the Opportunity Team (false)
ADD A DECISION: You will have a decision for Add or Remove the user
Select_Action = True >>> It means Add
Otherwise, default >>> It means Remove
SCREN #2: In this screen add 2 lookup components
Lookup 1: Opportunity Owner
API Name: OpportunityOwner
Field API Name: CreatedById
Label: Opportunity Owner
Object API Name: Opportunity
Lookup 2: AddOOOCoverage
API Name: OpportunityOwner
Field API Name: CreatedById
Label: Add OOO Coverage
Object API Name: Opportunity
SCREEN #3: Add 1 lookup component
Lookup 1: Opportunity Owner
API Name: RemoveOOOCoverage
Field API Name: CreatedById
Label: Remove OOO Coverage
Object API Name: Opportunity

Let's complete the actions to "Remove" the user
GET RECORD: Opportunity Team Member
Criteria:
UserId = RemoveOOOCoverage > Record Id
TeamMemberRole = OOO Coverage
Get all records and store only the ID
DELETE RECORD: Use the IDs stored in a record variable or record collection variable
Record or Record Collection = Opportunity Team from GET RECORD Opportunity Team Member

Now let's focus on the Add Members
GET RECORD: Opportunity
Criteria: OwnerId = OpportunityOwner > RecordId
Get all records and only store the ID
LOOP: Get Record Opportunity
First item to last item
Create 2 new Variables:
Single Variable: VAR_OppTeam

Collection Variable: COL_OppTeam

ADD ASSIGNMENT 1: Assign Single Variables
VAR_OppTeam > Opportunity ID = Current Item from Loop LOOP > Opportunity ID
VAR_OppTeam > User ID = AddOOOCoverage > Record Id
VAR_OppTeam > Opportunity Access = Edit
VAR_OppTeam > Team Role = OOO Coverage
ADD ASSGINMENT 2: Add to List
COL_OppTeam Add VAR_OppTeam
CREATE RECORD: Create Opportunity Teams
Multiple
Record Collection: COL_OppTeam
Put your flow together:

As a last Step add your flow through a LEX Home Page component, as quick action or in the utility bar. Whatever fits you :)


Comments