Validation Rule Formula on Opportunities - Answers - Salesforce Trailblazer Community
Ask Search:
Michelle AlvarezMichelle Alvarez 

Validation Rule Formula on Opportunities

Hello, everyone.

I'm creating a Validation Rule but I'm actually a beginner on them and I don't have a clue on how to write it.

It should be a Validation Rule on Opportunities where the Probability (%) cannot be manually changed if the User Role is equals to "Consultant."
I have the structure on my head but I cannot seem to write it down on the rule.


Thank you in advance!
Best Answer chosen by Michelle Alvarez
Narender SinghNarender Singh
Ohh, missed a comma. Try this:
AND(
CONTAINS($UserRole.Name,"Consultant"),
ISCHANGED(Probability)
)

 

All Answers

Narender SinghNarender Singh
Try this:
AND(
$UserRole.Name="Consultant",
ISCHANGED(Probability)
)

 
Michelle AlvarezMichelle Alvarez
Thank you very much.
I'm gonna try it.


Will it work if the user role contains the word Consultant but changes a bit?

Example:
MX - Consultant
MX - Manager
MX - Director

Can I change the word "Consultant" for "MX -"?
Michelle AlvarezMichelle Alvarez
Thank you very much for the fast reply.

I get an error reading this: Syntax Error. Missing ')'
And it's on the line ISCHANGED
Narender SinghNarender Singh
Ohh, missed a comma. Try this:
AND(
CONTAINS($UserRole.Name,"Consultant"),
ISCHANGED(Probability)
)

 
This was selected as the best answer
Michelle AlvarezMichelle Alvarez
Thank you very much for your help!