How to give filter to show whose role profile is 'crm channel partner'


if i select lead type as channel partner then show me those users whose role profile is ‘crm channel partner’

@Rahul7218

  frappe.ui.form.on('Lead', {
	type(frm) {
	if(frm.doc.type==='Channel Partner'){
frm.set_query("custom_channel_partners", function (doc) {
			return {
				filters: {
					role_profile_name :"CRM Channel Partner"
				},
			};
		});}
		
	},
	
})