Is it possible to make a single field only visible to the record owner, dependent on the user's role?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a table for Sales Quotation requests. It is visible by many users such as Sales Reps, Managers, Estimators, etc.

Ideally, I would like a formula (or another solution) that says if the user role is Sales Rep, the Expected Commission field (numeric percentage field) is only visible (once filled out) to the record owner.

This would prevent Sales Rep A from looking at the commission field in the quote request submitted by Sales Rep B. Sales Rep B does not want A knowing what his expected commission will be for the customer.

Other user roles will either have no access to the field or full access to the field.

Thank you!

Photo of Brittany

Brittany

  • 210 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Blake Harrison - DataBlender

Blake Harrison - DataBlender, Champion

  • 100 Points 100 badge 2x thumb
There are probably several different ways to do this, but the simplest may just be to have 2 fields that do this same calculation. One field would be intended for the Sales Reps role, while the other would be for any other role that should be able to see the commission value.

For the first field, you'll want to modify your formula to look something like this:

IF(User() = [Record Owner],Insert your commissions calculation here,0)

You can then either use Form Rules to show/hide that field based on Role OR have a separate form for the Sales Rep role.

The second field would just be your standard commissions calculation. This would also be the field that you use in any reporting or other calculations your Stakeholders may need to see. To ensure that the Sales Reps role cannot access it, you would select the "Limit Access by Role" option in the properties and make sure that Sales Reps shows as None.
Photo of Brittany

Brittany

  • 210 Points 100 badge 2x thumb
Thank you Blake, this is very helpful. I hadn't thought of having two similar fields with different permissions.
The commission field actually is not a calculation, but instead just an inputted percentage by the Sales Rep. They can technically type in any percentage they want; it is telling us what commission they hope to gain on the sale.
If I am to make a second field, is it possible for the second (view only field) to have a formula to populate with whatever was inputted into the original field by the Sales Rep?
Hi Brittany,
You can create a formula user field that identified the "Current User"  User() then create a form rule that says if current user is not equal to record owner hide the "Expected Commission Filed" you can further tailor this to only hide the field from users in the role of "Sales Rep" this would allow users in an admin role to see this fields.

Also keep in mind that you may want to limit viability of this field in reports. if you sales Reps have permission to build reports they can create reports with this filed.

Best,
Photo of Brittany

Brittany

  • 210 Points 100 badge 2x thumb
Hi Leo, this is exactly what I had in mind. Could you explain how to create these form rules?
Hi Brittany



Sure, this should work without you needing to create a new field. 

Go to form rules and create a new rule, (this is a two part rule) first select when "The user" "Is in the role" of "Sales Rep", then select add another condition. The second condition will be when "Record Owner" "is not equal" to "the current user". Under Action select "hide" then select the filed "Expected Commission"


see attached pic. Note: please make sure your second condition is "is not equal to" in the picture it shows "is equal to" and this is wrong for your use case.

Best,
Hi Brittany,
Sure, go to form rules and create a new rule, (this is a two part rule) first select when "The user" "Is in the role" of "Sales Rep", then select add another condition. The second condition will be when "Record Owner" "is not equal" to "the current user". Under Action select "hide" then select the filed "Expected Commission" (see above under answer I was able to add a picture)