Adding a Button in List View for a Single Doctype

I am currently working on customizing the list view of a specific doctype and would like to inquire about adding a button. My intention is to include this button exclusively for this particular doctype, without affecting any others.

Could you please provide guidance on how to achieve this customization?

Reference:

I am unable to create button in the listview please explain me clearly

See all the references given to you and apply the Listview client script.

i am also apply same action but i am not getting the result

My Script:

My Doctype:

Check first example in reference:

In v15/14, the syntax is changed.

Hi @NCP is there a way we can disable these actions based on role?

possible using frappe.user.has_role

frappe.listview_settings[‘Doctype’] = {
onload: function(listview) {
if (frappe.user.has_role(‘Role’)) {
listview.page.clear_actions();
} else {
listview.page.add_action_item(__(“Actions”), () => {
frappe.msgprint(“Action Clicked”);
});
}
}
};

i tried this code but its hiding for all roles.
can you help me out?

Example: How can we remove user images from assign to tab - #8 by NCP

Thanks! Appreciate the response!