I have a button on a form for doctype A. When I click it, frappe.set_route is called in A.js which takes us to the form for doctype B.
Doctype A contains doctype B as a link field.
How can I link the document created for B to the parent document of A?
Maybe by passing a parameter from A to B when I call frappe.set_route?
You can use the frappe.model.open_mapped_doc from document A. It will redirect you to document B and you will be able to access the document A’s fields.
Ok, Apologies if my question isn’t clear. From your statement, I assume that route_options can only be pushed and retrieved on the client-side java-script. Can you confirm that?
Also, an example of how the parameters passed in the route_options can be retrieved at the receiving end would be great. Many thanks for your support.