How do I restrict Users Profile edit access for Standard Field, for a specific Opportunity Record Type? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Chantal LambertChantal Lambert 

How do I restrict Users Profile edit access for Standard Field, for a specific Opportunity Record Type?

Hello,

Using the VR below, if I need to add one more Profile.Name (PS/G2 Hybrid) in the restricted section. How would this be showing in the formula ? Basically, how do you specify more than one Profile.Name for a restricted access ? 

AND(
NOT(ISNEW()),
ISCHANGED( StageName ),
$Profile.Name  <> "Professional Services",
RecordType.Name="Professional Services")

Thank you,
Chantal
Best Answer chosen by Chantal Lambert
Steve DoddSteve Dodd
Chantal, try doing it like this...
AND(
NOT(ISNEW()),
ISCHANGED(StageName),
RecordType.Name = "Professional Services",
OR(
$Profile.Name = "Professional Services",
$Profile.Name = PS/G2 Hybrid"
)
)

 

All Answers

Steve DoddSteve Dodd
Chantal, try doing it like this...
AND(
NOT(ISNEW()),
ISCHANGED(StageName),
RecordType.Name = "Professional Services",
OR(
$Profile.Name = "Professional Services",
$Profile.Name = PS/G2 Hybrid"
)
)

 
This was selected as the best answer
Deepak AnandDeepak Anand
Try this = 
AND(
    NOT(ISNEW()),
    ISCHANGED(StageName),
    RecordType.Name = "Professional Services",
    CASE(
        $Profile.Name,
        "Professional Services", 1,
        "PS/G2 Hybrid", 1,
        0
    ) = 1
)
Chantal LambertChantal Lambert
@Steve Dodd
Hello Steve,
It works ! I only changed the OR by AND, as I need both to apply. 

Thank you ! 
Chantal
Steve DoddSteve Dodd
When you say you changed it to AND, did you do something like this ?
AND(
$Profile.Name = "Professional Services", 
$Profile.Name = "PS/G2 Hybrid" 
)

No Profile can be both "Professional Services" and "PS/G2 Hybrid"  - that's going to cause issues

 
Chantal LambertChantal Lambert
Hi Steve,

Actually, my exact VR is like this (see below). I need to only have these two profiles be able to change the stage for this specific Record Type. I logged in as users with either the "PS/G2 Hybrid" or "Professional Services" Profiles and it is working ok. Did I miss something ?

AND( 
NOT(ISNEW()), 
ISCHANGED(StageName), 
RecordType.Name = "Professional Services", 
AND( 
$Profile.Name <> "Professional Services", 
$Profile.Name <> "PS/G2 Hybrid" 

)
Steve DoddSteve Dodd
Then doing it that way would cause the rule to fire for everyone who is not in one of the two Profiles, as long as the other three conditions in the rule are also met - is that what you wanted to do ?
Chantal LambertChantal Lambert
Yes ! I want to only have these two profiles be allowed to make changes to the Stage, when in a "Professional Services" Record Type. 
Steve DoddSteve Dodd
OK, then you should be fine...but let me know once you test it if you experience any issues and we can take another look at it.

I think your post threw me a little where it said you wanted to add a Profile Name for restricted access - I took that to mean you wanted to restrict the users in the Profile you were adding, so they wouldn't be able to change the Stage.
 
Chantal LambertChantal Lambert
Sorry for the confusion Steve... and thank you for your help. I will test it and let you know if there is any issue. 

Chantal