Automatically change field label based on role profile


i have this ‘Channel Partner Cost’ field in opportunity doctype i want to show this field name as ‘Channel Partner Commission’ in those users whose role profile is ‘‘CRM Channel Partner’’

Hi, it is possible using client script. It is a simple client script. I checked your previous posts, so I think you have to check your own previous post because everyone provides you client script with different concept but you have little bit but add your logic and develop easily.

Example :

frappe.ui.form.on('Opportunity', {
	refresh(frm) {
		if (frappe.user.has_role('CRM Channel Partner'){
            frm.set_df_property('channel_partner_cost','label','Channel Partner Commission');
            frm.refresh_field('channel_partner_cost');
        }
	}
})
1 Like

hi @Shiv_P
i have try first from my side
after that i raised the question here

Hi @Rahul7218, If you tried, then you should also share the script. So let me know how good you are about the client script.

If you had tried even a little, then you don’t have to do the same here because your next two or three topics were CRM (lead/opportunity) related and had similar concepts.

And you don’t even appreciate the answer because if the user gives you the answer then you don’t even give the response and you don’t even solve the topic and given the solution mark. I have seen this many times.

@Meet I appreciate your answer :smile: but you should also check old posts of some times users. Because many posts based on same concept are available in Forum. So you should provide the same reference to him so that he can learn. :+1:

1 Like