Hi,
I am currently creating a doctype that should only show records where name is equal to frappe.session.user.
I have checked on user_list.js with the listview_setting but could not find out how to do such.
Many thanks.
Hi,
I am currently creating a doctype that should only show records where name is equal to frappe.session.user.
I have checked on user_list.js with the listview_setting but could not find out how to do such.
Many thanks.
You will need to set the filters
attribute in listview_settings
. please check the user_list.js for the same.
e.g.
filters: [[“fielname”, “operator”, “value”]]
Thanks, Makarand
The problem with that is the filter can be deleted by the user. The User do not show other user records to other users, unless it is a System Manager or Administrator.
You will want to use role permissions to accomplish this.
Make sure you check “Apply User Permissions” on the doctype and make sure the User Doctype is selected in “Select Document Types”.
Also, make sure “Set User Permissions” is checked for the User doctype.
Found this useful. 2 follow up questions:
Is there an example in ERPNext that I can see and learn? I can’t figure out where it could be.
User Permissions is what you’re looking for: https://erpnext.org/docs/user/manual/en/setting-up/users-and-permissions/user-permissions.html