How to Customize "Create" Button Functionality?

Hello everyone,

There is a functionality in ERPNext where there is a “Create” button in the (Material Request) that creates (Request for Quotation) OR (Supplier Quotation) OR (Purchase Order), and also make it to inherit/copy the values from it.
Please kindly help me, I want to make the same functionality for a Custom doctype (Bill of Quantity) so that when a user raise a BOQ and then submit the BOQ, it will create a Material Request and also inherit/copy the values from it.


I am not a developer, Please kindly send me the function.

Hi @wolealadekoba,

Please check it.

frappe.ui.form.on('Your DocType', {
	refresh(frm) {
		frm.add_custom_button(__("Button Name"), function() {
				/* When this button is clicked, do this */
			}, __("Create"));


@NCP , it did not work.

@NCP , the code did not work.