Add Button in Menu in List View of Customer


I am currently trying to add a button in menu in the list view of customer. My problem is that I cannot see that button in customer list view. But if I change my doctype in code to “Lead” instead of “Customer” (or something else) it’s showing in list view of lead!

Here’s my code:

frappe.listview_settings[‘Customer’] = {
refresh:function(listview) {“button_name”), function() {{
method: “path_to_method”,
args: {}

Has anybody a solution for me?

For anybody with the same problem, i solved it! Instead of adding the script in my repository, I added a client script in ERPNext and checked “Is active”. This did the job.

I had posted about the issue that some js works in custom app’s doctype files and some only works in client script.
Is there any docs or explanation which can be in custom app and which should be in client script?

@rahy I didn’t find any docs for this topic. But I figured out why the script didn’t work in my repository! ERPNext has a file named “customer_list.js” with following code:

When I comment this code out, my script is working. I assume that it’s not possible to have 2 scripts with listview_settings for Customer. Maybe it’s the same problem with other files and processes.