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
Sreeraj JSreeraj J 

Check login user profile name in formula field

I want to check login user profile name without using $user.profileid in the formula field. I do not want to hardcode profile id as it differs from sandbox to production.
Best Answer chosen by Sreeraj J
Amit Chaudhary 8Amit Chaudhary 8
Please try like below
IF( $Profile.Name == 'Custom Test Profile'',"Agreed","Not Agreed")

Are you using Lighting ? There is one bug on same. Please check below post for workaround
1) https://success.salesforce.com/issues_view?id=a1p3A00000181gKQAQ

Please check below post for same issue
1) https://success.salesforce.com/answers?id=90630000000gmrvAAA
2) http://salesforce.stackexchange.com/questions/96189/profile-name-in-validation-rule-not-working

Let us know if this will help you
 

All Answers

Amit Chaudhary 8Amit Chaudhary 8
Please try like below
$Profile.Name == "System Administrator"
I hope that will help you
 
Sreeraj JSreeraj J
That did not help me. My formula now is IF( $User.ProfileId ='00e0H000001McO2'',"Agreed","Not Agreed").
If I change it to IF( $Profile.Name='Custom Test Profile'',"Agreed","Not Agreed") did not produce right result.
 
Amit Chaudhary 8Amit Chaudhary 8
Please try like below
IF( $Profile.Name == 'Custom Test Profile'',"Agreed","Not Agreed")

Are you using Lighting ? There is one bug on same. Please check below post for workaround
1) https://success.salesforce.com/issues_view?id=a1p3A00000181gKQAQ

Please check below post for same issue
1) https://success.salesforce.com/answers?id=90630000000gmrvAAA
2) http://salesforce.stackexchange.com/questions/96189/profile-name-in-validation-rule-not-working

Let us know if this will help you
 
This was selected as the best answer