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
Eric KellyEric Kelly 

Validation Rules for a Specific Profile

I need to require that users with our "Sales User" profile fill out a specific set of fields when the move an opportunity in to our "Closed Won" stage.  Other users/profiles will not have this requirement. 

I have other similar versions of this rule for a single field for all users and it works, but for this exercise, I need to account for 9 required fields and only with a specific profile.  My formula is not returning errors, but when I tested this with a Sales User, SF did not require them to fill out the fields.  I did change their profile moments before asking them to test.  Do Profiles take a few minutes to reflect a change.  (Yes - I did have them sign out, changed the profile, then had them sign back in.)

My current validation rule formula is:

AND(
CASE( StageName ,
"Closed Won", 1 ,
0 ) = 1 ,
ISBLANK( Vendor_Rep__c ),
ISBLANK( Vendor_Rep_Help__c ),
ISBLANK( Business_Challenges__c ),
ISBLANK( Business_Win_Process__c ),
ISBLANK( Key_Takeaway__c ),
ISBLANK( Solution_Search__c ),
ISBLANK( Competition__c ),
ISBLANK( Overcoming_Competition__c ),
ISBLANK( Implementation_Details__c ),
$Profile.Name = "Sales User"
)

Thanks for the help!
Best Answer chosen by Eric Kelly
HarshHarsh (Salesforce Developers) 
Hi Eric,

Please try the below code
 
AND(
    ISPICKVAL(StageName, "Closed Won"),
    $Profile.Name = "Sales User",
    OR(
        ISBLANK(Vendor_Rep__c),
        ISBLANK(Vendor_Rep_Help__c),
        ISBLANK(Business_Challenges__c),
        ISBLANK(Business_Win_Process__c),
        ISBLANK(Key_Takeaway__c),
        ISBLANK(Solution_Search__c),
        ISBLANK(Competition__c),
        ISBLANK(Overcoming_Competition__c),
        ISBLANK(Implementation_Details__c)
    )
)

Please mark it as Best Answer if the above information was helpful.

Thanks.




Important Update - what you need to do
User-added image
As a reminder, on December 4, 2023 the Salesforce Discussion Forums will be removed from the Salesforce Developers website. These forums will shut down and all relevant discussions will migrate to the Trailblazer Community digital platform.

During the week starting November 20, you can view discussions, but not post new questions or responses. On December 4, you will no longer be able to access the discussion forums from the Salesforce Developers website.

Please take these steps before November 30, 2023, 11:59 p.m. PT to ensure your contributions follow you to the Trailblazer Community:
  1. If you’re not already a member of the Trailblazer Communitysign up for a Trailblazer account using the same login email address associated with your Developer Discussion Forums account. This is crucial.
  2. If you already have a Trailblazer account, and it’s using a different email address from your Developer Discussion Forums account, we recommend that you log in to the Trailblazer Community and connect your forums email address to your Trailblazer account.
Find more info & support
We know that moving platforms can be a hassle, so we created a special forums users group, the Migration Support Hub, in the Trailblazer Community where you can get training videos, information, and assistance.

We are here to help you through this transition!

Sincerely,
The Forums Support Team

All Answers

HarshHarsh (Salesforce Developers) 
Hi Eric,

Please try the below code
 
AND(
    ISPICKVAL(StageName, "Closed Won"),
    $Profile.Name = "Sales User",
    OR(
        ISBLANK(Vendor_Rep__c),
        ISBLANK(Vendor_Rep_Help__c),
        ISBLANK(Business_Challenges__c),
        ISBLANK(Business_Win_Process__c),
        ISBLANK(Key_Takeaway__c),
        ISBLANK(Solution_Search__c),
        ISBLANK(Competition__c),
        ISBLANK(Overcoming_Competition__c),
        ISBLANK(Implementation_Details__c)
    )
)

Please mark it as Best Answer if the above information was helpful.

Thanks.




Important Update - what you need to do
User-added image
As a reminder, on December 4, 2023 the Salesforce Discussion Forums will be removed from the Salesforce Developers website. These forums will shut down and all relevant discussions will migrate to the Trailblazer Community digital platform.

During the week starting November 20, you can view discussions, but not post new questions or responses. On December 4, you will no longer be able to access the discussion forums from the Salesforce Developers website.

Please take these steps before November 30, 2023, 11:59 p.m. PT to ensure your contributions follow you to the Trailblazer Community:
  1. If you’re not already a member of the Trailblazer Communitysign up for a Trailblazer account using the same login email address associated with your Developer Discussion Forums account. This is crucial.
  2. If you already have a Trailblazer account, and it’s using a different email address from your Developer Discussion Forums account, we recommend that you log in to the Trailblazer Community and connect your forums email address to your Trailblazer account.
Find more info & support
We know that moving platforms can be a hassle, so we created a special forums users group, the Migration Support Hub, in the Trailblazer Community where you can get training videos, information, and assistance.

We are here to help you through this transition!

Sincerely,
The Forums Support Team
This was selected as the best answer
Eric KellyEric Kelly
Thanks you so much!  This worked.