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
Jennifer.SchnellJennifer.Schnell 

Account Validation Rule Restrict Profile and Specific User

I am trying to create a validation rule for the below:
1) Only certain profiles and Tom Smith may select the picklist value "Strategic" 
2) Once an account is designated as "Type = Strategic", only the above listed profiles/users may change it back to another value.

Below is what I have so far, looking for assistance on how to add a specific "user" to the below as well as #2 above.

AND(
ISPICKVAL( Type , "Strategic") ,

$Profile.Name <> "System Administrator Master",
$Profile.Name <> "Sales Administrator",
$Profile.Name <> "CSM System Administrator"
)
Best Answer chosen by Jennifer.Schnell
DavidSCDavidSC
Hi Jennifer,
If you have several profiles and a specific user, a custom permission is the best approach to cover both requeriments. It will be easier to maintain in the future without modifying the validation rule every time. Please review this answer from Deepak Anand:
https://success.salesforce.com/answers?id=9063A000000DXeZQAW

Hope it helps,
David

All Answers

DavidSCDavidSC
Hi Jennifer,
If you have several profiles and a specific user, a custom permission is the best approach to cover both requeriments. It will be easier to maintain in the future without modifying the validation rule every time. Please review this answer from Deepak Anand:
https://success.salesforce.com/answers?id=9063A000000DXeZQAW

Hope it helps,
David
This was selected as the best answer
Jennifer.SchnellJennifer.Schnell
Thanks @DavidSC.  How would I accomplish # 2 in a permission set though?
DavidSCDavidSC
@Jennifer follow the steps provided by Deepak in URL mentioned:

For requirement #1 something like this:
AND(
    CASE(
        "Strategic", 1,
        0
    ) = 1, 
    $Permission.Restricted_Picklist
)

For requirement #2 follow the screenshots in URL under text "In order to get the last line done, you will need to create a Custom Permission like as below:". With this configuration you will disallow value "Strategic" in field "Type" for Accounts only for those Profiles that have a custom permission named "Restricted_Picklist".
 
tatiparthi kotstatiparthi kots
Hi experts i have one task please let me know if any one having knowledge on this
we have text area long field in that if we enter  www.hpe.com url it has to save else if we enter any other url other than that it should restrict, how can we write validation rule for this.
please help me on this