+ Start a Discussion
Rick SF AdminRick SF Admin 

Lock record 7 days after specified picklist value

I'm trying to create a way to completely lock a record Org-Wide for a custom object (Announcement__c) 7 days (or even 7 business days) after the Status (picklist) has been changed to "Cancelled". Only system admins should have the rights to edit these records 7 days after the status changed. I also want to prevent users from changing the Status from "Cancelled" back to any other value after the 7 days. Currently I have a validation rule I've created (see below) but making it "time-based" and completely uneditable is the challenge. I'm not sure if this is the best approach but any other suggestions are apprecitated. 


AND( 
$Profile.Name <> 'System Administrator', 
OR( 
ISPICKVAL(Status_Master__c , "Cancelled") 
))
Best Answer chosen by Rick SF Admin
Rick SF AdminRick SF Admin
I resolved my issues. I created a time based PB that makes a custom checkbox field "True" 7 days after the status has changed to Cancelled. The FLS on the checkbox field is only visible to System Admin profiles. So I modified my Validation Rule to give an error if the checkbox equals True for non-System Admin Profiles making the record locked.

Validation Rule
AND( 
$Profile.Name <> 'System Administrator', 
(Locked__c = True))

All Answers

Rick SF AdminRick SF Admin
Elaborate please.
Steven NsubugaSteven Nsubuga
Check out this link (https://thewizardnews.com/2015/12/10/auto-lock-records-with-process-builder/) for a combination of Approval Process and Process Builder.
This is a more general link (https://sfdcfanboy.com/2017/04/26/7-ways-to-lock-a-record-in-salesforce/) with several options.
Rick SF AdminRick SF Admin
I resolved my issues. I created a time based PB that makes a custom checkbox field "True" 7 days after the status has changed to Cancelled. The FLS on the checkbox field is only visible to System Admin profiles. So I modified my Validation Rule to give an error if the checkbox equals True for non-System Admin Profiles making the record locked.

Validation Rule
AND( 
$Profile.Name <> 'System Administrator', 
(Locked__c = True))
This was selected as the best answer