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
Sanjana Rajasekar 9Sanjana Rajasekar 9 

Validation Rule to restrict Stages

I have requirement where, 
Stage 1 can skip to Stage 2 to 5 but not to Stage 6
How can this achieve by validation rule? Thanks in advance!
 
Best Answer chosen by Sanjana Rajasekar 9
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Sanjana,

Small correction. Can you try below.
 
AND(ISPICKVAL(PRIORVALUE(StageName),"stage1") , 	ISPICKVAL(StageName,"stage6") )

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Sanjana,

Can you be more specific. Do you mean we can move stage1 to stage2, stage3 ,stage4 and stage 5 but not to stage 6 from stage1 ?

Thanks
 
Sanjana Rajasekar 9Sanjana Rajasekar 9
We can move stage 1 to Stage 2 or Stage 3 or Stage 4 or Stage 5 , but not to stage 6 from Stage 1
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Sanjana,

You can check priorvalue(Stagename) and present value as below.

Replace the stage names in stage5 and stage1
 
AND(ISPICKVAL(PRIORVALUE(StageName),"stage5") , 	ISPICKVAL(StageName,"stage1") )

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
Sanjana Rajasekar 9Sanjana Rajasekar 9
Hi Sai Praveen,
When I execute this, I can move to stage 6 from stage 1. 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Sanjana,

Small correction. Can you try below.
 
AND(ISPICKVAL(PRIORVALUE(StageName),"stage1") , 	ISPICKVAL(StageName,"stage6") )

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Sanjana Rajasekar 9Sanjana Rajasekar 9
Thanks It worked! @Sai Praveen