1

I need to prevent users to change opportunity status back to an earlier stage once a specific stage has been reached.

StageName values in order are:

  • New
  • Preselection
  • Instruct
  • Closed (Won/Lost)

Once an opportunity has been marked "Instruct", users should not be allowed to go backwards.

I have tried the following validation rule, I get no error but it doesn't work:

AND(
  OR(
   PRIORVALUE( StageName )= "Instruct",
   PRIORVALUE( StageName )= "Closed won",
   PRIORVALUE( StageName )= "Closed lost"
  ),
 OR(
  ISPICKVAL( StageName , "Preselection"),
  ISPICKVAL( StageName , "New")
 )    
)

Can you help me out, please?

1 Answer 1

1

You'll want to use the CASE statement. We'll convert each option to a numerical value, and generate an error if the step is lower than the previous step.

CASE(
  StageName, 
  'New', 1, 
  'Preselection', 1, 
  'Instruct', 2, 
  'Closed Won', 3, 
  'Closed Lost', 3, 
  0 
) 
<
CASE(
  PRIORVALUE(StageName), 
  'New', 1, 
  'Preselection', 1, 
  'Instruct', 2, 
  'Closed Won', 3, 
  'Closed Lost', 3, 
  0 
)

You can assign the numbers however you want, this is just an example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .