How to manage OOO Coverage? - Solution #2
- Kriss Lugo
- May 12, 2021
- 2 min read
Followign our previous post let's build our second solution for OOO Coverage.
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 the vacation dates 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.
Because we don't want to manually add/remove the access; we will build a scheduled flow to do it for us!
Before we dig into flows, add a new opportunity team member role called: "OOO Coverage"
Now let's create a couple of fields:
Under the User Object create the following fields:
OOO Coverage (Lookup hierarchy)
OOO Start date (date)
OOO End Date (Date)
OOO Checker (Formula / Number):
IF(
TODAY() = OOO Start Date, 1,
IF(
TODAY() = OOO End Date, 2,
0 ) )
Now go to Flows and create a scheduled flow:
Let the flow run daily at certain time (maybe out of office hours?!)
Object: User
Condition Requirements: Any Condition Is Met (OR)
OOO Checker = 1
OOO Checker = 2
ADD DECISION ELEMENT: we want to know if we are adding or removing the access
Option 1: Add
$Record > OOO Checker = 1
Option 2: Remove
$Record > OOO Checker = 2
Option 3: Default Outcome
Let's build Option 1: Add
DRAG GET RECORD ELEMENT: We will get the Opportunity records where the current user is the owner
Condition Requirements: All Conditions Are Met (AND)
OwnerId = $Record > User ID
All records
Choose fields and let Salesforce do the rest (Only the ID)
DRAG A LOOP: Here you will call the {!GET_OPPORTUNITY} element
First item to last item
CREATE SOME VARIABLES:
VAR_OPPTEAM: Single Record Variable
Object: Opportunity Team Member
Available for input / Available for output
COL_OPPTEAM: Collection Record Variable
Object: Opportunity Team Member
Allow multiple values (collection)
DRAG AN ASSIGNMENT: We are going to assign the values to the variable single
VAR_OppTeam > Opportunity ID = Current Item from Loop LOOP > Opportunity ID
VAR_OppTeam > User ID = $Record > OOO Coverage
VAR_OppTeam > Opportunity Access = Edit
VAR_OppTeam > Team Role = OOO Coverage
DRAG AN ASSIGNMENT: Add to List
COL_OPPTEAM Add VAR_OPPTEAM
CREATE RECORD: Create Opportunity Teams
Multiple
Record Collection: COL_OPPTEAM
Put it together and it will look like this:

Let's build Option 1: Remove
DRAG GET RECORD: Opportunity Team Member
Condition Requirements: All Conditions Are Met (AND)
UserId = $Record > OOO Coverage
TeamMemberRole = OOO Coverage
All records
Choose fields and let Salesforce do the rest (Only the ID)
DRAG 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 you just sit back, take note of the coverage and update the User page when need it!

コメント