function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shiva VenuShiva Venu 

Unable to edit Record with validation rule

We have this lead status on Lead object

Lead Status Pick values : New, New Response, In Progress, Rejected, Qualified

We wanted to restict users from switching status and editing records

1) When New or New Response status, user should not be able to edit any record/field on Lead until the status changes to Inprogress

2)  When the status is Inprogress, user can only change it to rejected or qualified. But can edit record with Inprogress status

I got some help and added the below validation rule.
The problem is with InProgress status, its does not allow users to update any other field/record value. It only allows user to update and save with rejected or qualified status. 

Can someone pls help, on how can we allow user to edit record/fields in Inprogess with the same validation rule below.
 
AND(
 ($Profile.Name = 'System Administrator'),
 IF(
 AND(
 OR(ISPICKVAL(PRIORVALUE( Status ),"New"),
    (ISPICKVAL(PRIORVALUE( Status ),"New Response"))),
    NOT(ISPICKVAL( Status ,"In Progress"))),
	true,
	IF(
	AND(
	(ISPICKVAL(PRIORVALUE( Status ),"In Progress")),
	AND(NOT(ISPICKVAL(Status ,"Qualified")),
NOT(ISPICKVAL(Status ,"Rejected"))
)),true,false)	
	)
   )

 
CharuDuttCharuDutt
Hii Shiva
Try Below Validation
AND($Profile.Name = 'System Administrator',
OR(AND(
ISPICKVAL(PRIORVALUE( LeadStatus_2__c ),"In Progress"),
AND(NOT(ISPICKVAL(LeadStatus_2__c ,"Qualified")),
NOT(ISPICKVAL(LeadStatus_2__c ,"Rejected"))
)),AND(NOT(ISPICKVAL( LeadStatus_2__c ,"In Progress"),
OR(ISPICKVAL(PRIORVALUE( LeadStatus_2__c ),"New"),
ISPICKVAL(PRIORVALUE( LeadStatus_2__c ),"New Response"))))))
Please Mark It As Best Answer If It Helps
Thank You!
Shiva VenuShiva Venu
Hi Charu, I tried to add this rule but its erroring saying ')' is missing.
 
CharuDuttCharuDutt
Hii Shiva 
Below Validation is working in my org and saved successfully
AND(
$Profile.Name = 'System Administrator',
OR(AND(
ISPICKVAL(PRIORVALUE( Status ),"In Progress"),
AND(NOT(ISPICKVAL(Status  ,"Qualified")),
NOT(ISPICKVAL(Status ,"Rejected"))
)),AND(OR(ISPICKVAL(PRIORVALUE( Status ),"New"),
ISPICKVAL(PRIORVALUE( Status ),"New Response")),
NOT(ISPICKVAL( Status  ,"In Progress")))))
Please Mark It As Best Answer If It Helps
Thank You!