How to pass parameter in set_route() method

I want to pass a variable or name to another doctype using set_route() but I could not found any option in the docs . is there any way to pass data from one doctype to another doctype.

    let name = "John";

any help will be much appreciated
Thanks in advance


Try this

var your_btn = frm.add_custom_button(__('Give Button Name'), function () {
                const wo = frappe.model.get_new_doc('Sales Order'); =;
				wo.customer = frm.doc.customer;
				wo.naming_series = "WO/SER/.FY./.####";
				frappe.set_route('Form', wo.doctype,;

Hi @maliknaqibullah,

More details for check it.

Thank You!

Thank you @Hardik_Gadesha. This works if I am trying to open an existing entry. However my challenge is that i want to route to a new page to create a new document.

Thanks @NCP I have tried that but in new document page we can not access that route _option data. it is only accessible inside current page.

if you know the server script then also you can go with get_mapped_doc method from python side. @maliknaqibullah

function create_new_doc(frm) {
	frm.add_custom_button(__('Quotation'), function(){
			method: "",
			frm: frm,
		}, __('Create'));
def function_name(source_name, target_doc=None):
	target_doc = get_mapped_doc(
			"Customer": {
				"doctype": "Quotation",
				"field_map": {
					"name": "party_name",

	return target_doc