frappe.listview_settings[‘Lead’] = {
onload: function(listview) {
frappe.call({
method: “frappe.client.get_value”,
args: {
doctype: “User”,
filters: { name: frappe.session.user },
fieldname: [“role_profile_name”]
},
callback: function(response) {
if (response && response.message) {
var role_profile = response.message.role_profile_name;
// Check if the role profile is 'CRM Channel Partner'
if (role_profile === "CRM Channel Partner") {
// Apply filter for the current logged-in user
frappe.route_options = {
_assign: ["like", frappe.session.user]
};
listview.refresh();
}
}
}
});
}
}; this script is correct?
i want apply filter assign to user name those user whose role profile is crm channel partner but script not work