How to make a button "Create" Functionality? ( Like in Material Request)

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 inherit/copy the values from it.