Temporary Edit Access with Teams
Case: Temporary Edit Access with Teams
This story show an example using case teams but the same concept can be applied to opportunity and account teams
This story is assuming the Case creator does not have edit access to the Case, but needs to update the Case details when the Case status is 'Needs Review'
Design
As a Salesforce User
I want to provide temporary edit access to the case creator when it is in status 'Needs Review'
So that the case creator can update the case details
Given I am on a Case record page
When the Case status is 'Needs Review'
Then the Case creator has temporary edit access to the Case
Build
To-do:
- Create new Case Team Roles for read and write access
- Create a flow to add and amend the case creator team roles
Create Case Team Roles
Setup > Service > Case Teams > Case Team Roles > New
Member Role Name: Read/Write Access
Access Level: Read/Write
Flow
Flow Label: Case: Needs Review Edit Access
Description: Adds and removes the Case Creator from the Case Team when the Case status is 'Needs Review'
Type: Record Triggered Flow
Trigger: A record is updated
Object: Case
Conditions: All Conditions Are Met (AND) \
- Staus -> Is Changed -> True
Optimize the Flow for: Actions and Related Records
Element: Get Records
Label: Get Read/Write Role
Set Filter Conditions: \
- Name -> Equals -> Read/Write Access
How Many Records to Store: Only the first record
Element: Decision
Label: Needs Review Status \
-
- Label: Moved Into Needs Review Status
{!$Record__Prior.Status}
-> Does Not Equal -> Needs Review{!$Record.Status}
-> Equals -> Needs Review
-
- Label: Moved Out of Needs Review Status
{!$Record__Prior.Status}
-> Equals -> Needs Review{!$Record.Status}
-> Does Not Equal -> Needs Review
Element: Create Records
Label: Create Case Team Member
How to set record field values: Manually
**Object: Case Team Member
**Set Field Values:**
- MemberId ->
{!$Record.CreatedById}
- ParentId ->
{!$Record.Id}
- TeamRoleId ->
{!Get_Read_Write_Role.Id}
Element: Get Records
Label: Get Read/Write Memeber
Object: Case Team Member
Condition Requirements
- ParentId -> Equals -> {!$Record.Id}
- TeamRoleId -> Equals -> {!Get_Read_Write_Role.Id} How Many Records to Store: Only the first record
Element: Delete Records
Label: Delete Read/Write Memeber
Object: Case Team Member
How to Find Records to Delete: Use the IDs stored in a record variable or record collection variable
Record or Record Collection {!Get_Sales_Read_Write_Memebr}
Test
Steps
- Create a new Opportunity or edit an existing Opportunity
- Save the Opportunity
- Check the Opportunity Name field
Expected Results
- The Opportunity Name is automatically formatted using the Account Name, Record Type, and Close Date
- The Opportunity Name is consistent and easy to read
- The Opportunity Name is displayed in the format 'Account Name | Record Type | dd/mm/yyyy'