ERPNext Conference 2019* Blog

Triggering function on load of doctype list view


Hello World,

I’m trying to trigger a function on load of a doctype’s “list view”. I know about

frappe.ui.form.on("{DocType}", "onload", {function})

but that will not run on a doctype’s “list view”. It will run on the New {DocType} view.

I also know about

onload: function(listview) {


but that will also not run on a doctype’s “list view”. It will run on load of a doctype and it will run the functions in the “listview”.

What is the trigger for this event?

Here is the ToDo doctype’s list view:

ERPNext integration with Signaturit

Refer below link.


Thanks @suyash for the reply.

That doesn’t solve my issue. This is just the same as I was talking about. It is “onload” of the “New {DocType}” view. It is adding new menu items to the list view page but it isn’t triggered when a user visits that page


could be same error as:



Thanks for the help.

What I have isn’t really an error, it may be a feature request or maybe the feature already exists, I’m not sure. I don’t think your link helps me though.

Thanks anyway


Have you found a solution? ,
I also encountered a problem similar to yours


For list view operations you might create a file like doctypename_list.js under the respective doctype folder.

After that you can write a onload function inside this list file.




thank you for your answer ,

but that still isn’t a solution.

onload only occurs when you press the F5 or Refresh button.

but when you open via the Search function it won’t work anymore

let’s just say it happens only once. whereas I want to run the script when I open the list


You can write a code on refresh function instead onload

Ex. refresh: function(frm){

it will works on Search function too


I tried it, the function didn’t work

frappe.listview_settings['Payment Entry'] = {
            console.log("Running Function this");


hey, remove ‘=’ from you code


hey guys

Is there any trigger when i select purchase order list check box. you can see in image


Facing Same issue…

In list view, refresh function not working