I’m trying to add a custom button. What this button actually do is duplicate the current form and add pre-fill few other fields. This is the code
frm.add_custom_button("Add Supplementary", ()=>{
frappe.set_route('Form', 'Contract');
})
But this redirecting to the list view instead of form.