How to add a custom button on child table

My apologies, below is working code:

frappe.ui.form.on('Quotation', {
	refresh(frm) {
		frm.fields_dict["items"].grid.add_custom_button(__('Hello'), 
			function() {
				frappe.msgprint(__("Hello"));
        });
        frm.fields_dict["items"].grid.grid_buttons.find('.btn-custom').removeClass('btn-default').addClass('btn-primary');

	}
})

image

13 Likes