hi
i have a custom doctype … i add a custom field in project doctype for that custom app type link …
when i click on that link and chose to create new … it should pass the field i have in project called project_name to my custom doctype field called project_name
but this not happening
@vijaywm … this is awesome i didn’t know this trick before … but my case is reverse this one
what happen here you are in project called p_test and you create sales order called so_test so after you finish creating sales order you will go back to p_test and link field is filled with value so_test …
what i’m hoping to do is
in p_test you click on new sales order (contains filed called project ) when sales order open it is automatically filled with P_text in project field
i can solve it by adding a custom button with
frappe.route_options = { “project”:cur_frm.doc.name,“customer”:cur_frm.doc.customer}
frappe.set_route(“List”,“Doctypename”)
but i want it to override link field itself or get it in the other page … it’s just like get parameter to pass parameters between pages but trigger by link field and catched at the destination
If that route is difficult, an easier option may be to modify your custom_doctype.js and check the previous route in on_load… and set the project field
onload: function (frm) {
var prev_route = frappe.get_prev_route();
if (prev_route[1] === 'Project') {
frm.set_value("project", prev_route[2]);
}
}