Button open Doctype in new tab

Hiiii,
How can I make button open doctype in new browser tab? the following custom scribt opening in the same tab, I need to change it to open in new tab.

frappe.ui.form.on(“form”, “mybutton”, function(frm) {
frappe.new_doc(“nc”, {“ncemp”: frm.doc.emp});
});

Thanks in advance

window.open('#Form/DocTypeName/New DoctypeName 1', '_blank')

4 Likes

Thanks @netchampfaris for your support.
Please I need to transfer data from current doctype to new one (some fields data) .
In my case:
Button name: bb
Current doctype: form1
New doctype: nc form
Filed in current doctype to be transfered : cur1
Fied in new doctype created: cur2
I am not a developer please help

you need to add a script.

use erpnext.utils.map_current_doc(js) get_mapped_doc(py) function. It helps you to map one form into another.

check,

2 Likes

Thanks @Sangram I will check

NameError: name ‘window’ is not defined
what module is window in?