Show data based on field value

I have this column in my doc type eg: employee

Designation Amount
Director 3000
Manager 2000
Officer 1000

There are 2 users: Tom and Petty
Tom needs to see amount of everyone (i.e. 3000, 2000 and 1000)
But Petty needs to see amount of officer only( i.e. 1000)
Is there any way to achieve this?

I tried doing this with “Field level permission” and “Role Permissions Manager”. I changed the permission of the “amount” field to “2”. Applied permission level “2” to Tom. As usual, Tom can see amount of everyone. But Petty has no visibility of “amount” data. I want Petty to see “amount” of officer.

Any help is appreciated.
Thank you.

for this use case, you got to use user permission,

  1. designation should be link field, in other word, designation is an independent doctype
  2. create user permission for Petty to allow designation Officer only.

Hello szufisher,

Thank you for your help.

I tried as you have said.
I added permission to Petty with Designation “Officer”. Now, Petty is able to see the row with Designation “Officer” only.

Like this:

Designation Amount
Officer 1000

However, I want Petty to see Director and Manager row. But Petty should not see “Amount” of Director and Manager
Like this:

Designation Amount
Director
Manager
Officer 1000

for your above mentioned use case, there is no out of box solution, maybe you can try to override get_list and add onload event for the doctype, I do think this is special case, you got to do the customization by yourself.

Thank you for your help.

I have one more issue.

I changed permission level of some fields to “1” in the doctype “doctype1”
I created a role called role1. For this role, I gave read/write access and permission level “1”. I assigned this role “role1” to the user “tom”
But when user “tom” tried to access the doctype “doctype1”, it gives me error message.
The error message is:

Not found
Page doctype1 not found
The resource you are looking for is not available

When I changed the permission level to “0” and gave read permission, user “Tom” is not able to access and read the doctype “doctype1”

My understanding is if you give read/write access in permission level “1”, the user “tom” with role “role1” should able to read this doc type “doctype1” with only the fields that have permission level “1”. Am i correct? or I am missing something here?

I mean the customization for your case involves writing some code by developer.