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
Patricia Mozzoni 6Patricia Mozzoni 6 

On Case object, how to prevent a case entered with status of 'new' from being moved directly to 'resolved'?

I need to prevent a new case from skipping the Investigate status and going directly to resolved.  I want an error message to display with my validation rule, but the rule is not working at all.

AND( 
$Profile.Name <> "System Administrator", 
RecordType.Name = "Complaint ", 
ISCHANGED( Status ), 
OR( 
ISPICKVAL(PRIORVALUE( Status ), "New") 
), 
NOT( ISPICKVAL( Status, "Resolved")) 
)
samdevsamdev
Modify your rule to the below formula and let me know if it works for you.
AND( 
$Profile.Name <> "System Administrator", 
RecordType.Name = "Complaint ", 
ISCHANGED( Status ), 
ISPICKVAL(PRIORVALUE( Status ), "New"), 
ISPICKVAL( Status, "Resolved")
)
Patricia Mozzoni 6Patricia Mozzoni 6
Thank you, but this modification did not work. There is a Status in between “Investigate”. I am wondering if I somehow have to include all of the values for this to work?
samdevsamdev
It should work. Can you check if you are testing it with Sys admin profile. We are excluding sys admin in the formula. also confirm if the record type is complaint.
Patricia Mozzoni 6Patricia Mozzoni 6
Yes, I logged in as another user and can confirm that I am using the correct record type.
samdevsamdev
I have just tried it myself and it worked. Can you also make sure that the rule is activated?
Patricia Mozzoni 6Patricia Mozzoni 6
Thank you! I realized that there was a space after the name of the record type and before the quote end.  That was keeping it from firing.  Very much appreciate your help!  One thing done today :)
samdevsamdev
You're Welcome!