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
Marco P.Marco P. 

$UserRole.Name not showing in formula field

Hi,

I'd like to use the User Rolename from the logged in user in a validationrule on an Opportunity but I can't get it to work. I made a formula text field to show $UserRole.Name to see the result but it is empty or not showing. Tried $UserRole.RollupDescription. Also empty or not showing.

UserRole.Name

I quess that is why my validationrule is not working.

I can't find any topic on it but it seems like none of the UserRole fields has any result or it is not showing when I open an Opportunity.

What did I do wrong?

regards,
Marco
Best Answer chosen by Marco P.
Bavadharani GanesanBavadharani Ganesan
Hi Marco,

Please make sure that the user has a role. If the user has a role means it will be displayed in formula field and validation rule is also working for me. Just create one formula field to show the role name. Create an opportunity record and see the value in the formula field. If the value is not showing means, just Check the role in the user detail page of record who created.

All Answers

Bavadharani GanesanBavadharani Ganesan
Hi Marco,

Please make sure that the user has a role. If the user has a role means it will be displayed in formula field and validation rule is also working for me. Just create one formula field to show the role name. Create an opportunity record and see the value in the formula field. If the value is not showing means, just Check the role in the user detail page of record who created.
This was selected as the best answer
Marco P.Marco P.
OMG, I tested it with the only user without a Role....... me !
D*mn, sorry for wasting your time.
Bavadharani GanesanBavadharani Ganesan
Hi Marco,

Please mark it as best answer if it is helpful for you. Did you got the role now?
Marco P.Marco P.
Yes. The formula field with UserRole.Name is showing value. Thnx