Reputation: 25
I'm trying to get a Validation Rule on my opportunities that only fires when a non-admin tries to Close Win. However, I'm running into a problem when a non-admin user moves the opportunity to Closed Lost (which I want them to be able to do)
I've tried different variations of the rule below. I cannot find a separate stage name for Closed, Closed Won, & Closed Lost.
AND (
ISPICKVAL(StageName, "Closed Won"),
$User.Id <> "005j000000FPcwR")
The Validation Rule should only fire on Closed Won, not Closed Lost
Upvotes: 0
Views: 1728
Reputation: 90
I would first recommend updating the $User.Id reference to point to the Profile Id (updating the Id correctly in the process). Then I would wrap the ISPICKVAL with a NOT(). Validation rules evaluate to the error case, not the accepted case.
Replace the Id found being compared to the ProfileId with the appropriate value you need, but I believe this should do what you need:
AND(NOT(ISPICKVAL(StageName, "Closed Won")), $User.ProfileId <> "00e36000001XAnQAAW")
Upvotes: 0