How to create and route a document without save?

How can I create and route to a new document which is not saved?

Like when we make a Sales Order using Quotation doc, we are redirected to a ‘New Sales Order #’, but I don’t want to fill it.
So, how can I redirect to that kind of doctype which don’t have a docname?

I think frappe.model.make_new_doc_and_get_name is what you’re looking for.

1 Like

Thank you very much @tmatteson , follow the entire code if someone need it:

frappe.ui.form.on('SomeDocType', function() {
    some_trigger: function () {
		local_docname = frappe.model.make_new_doc_and_get_name('Quotation')
		frappe.set_route('Form', 'Quotation', local_docname)
    }
});