Add custom button on form toolbar

How to add an option of “stop” option in newly created document.

frm.on("[doctype]", {
  refresh: function(frm) {
    frm.add_custom_button(__('Open'), function() { 
        // click
      }, __('Show'));


Thanks Rushabh.
I have created a custom script for the doctype and pasted above code. But document displays nothing.
Could u please tell me what wrong I did?

I have replaced “doctype” with name of the doctype.
I have tried without replace also.

Trying the same,

frm.on("ABC", {
  refresh: function(frm) {
    frm.add_custom_button(__('Click here'), function() { 
        // click
      }, __('New'));

What i want to do is disable the “New” button on form page and make a new button with name “click here” and set the exact same task done by new to that button.

Any help ??


frappe.ui.form.on('Opening Invoice Creation Tool', {
	refresh: function(frm) {
		frm.trigger("make_dashboard");"Make Invoices"), () => {
			let btn_primary =;