Cutom Button dont working

i am create a buttong on my doctype , but when i call this button on js file but its not working pls help


@Rahib_Hasan

Use field type as Button instead of HTML script.

Script

frappe.ui.form.on('Training Schedule', {
	get_schedule: function(frm) {
		//your script
	}
});

@Rahib_Hasan
replace
cur_frm.fields_dict.get_schedule_custom_button.$wrapper
to
cur_frm.fields_dict.get_schedule_custom_button.wrapper

just remove $

vai try it but its not working

Try this

frappe.ui.form.on('Training Schedule', {
	refresh: function(frm) {

	     $(frm.fields_dict.get_schedule_custom_button.wrapper).find('.get_schedule').on('click', function(){
                     console.log("Hello");
                    msgprint("Got it")
            })
	}
});