Hi, I have a doctype called Participant and another doctype called Assessment Form. In the Assessment Form doctype there is a field linked to “Participant”. I have created a button called assessment forms, which links to assessment forms. However I want to filter the assessment forms displayed based on the “participant” field in assessment form. E.g There is a participant called “Sarib”. I want to click on the “Assessment Forms” button and display all assessment forms where the participant is “Sarib”. My code right now is partially working, the button takes me to the assessment forms but it doesn’t filter the results on the basis of the participant.
Code:
frappe.ui.form.on("Participant", "button1", function(frm) {
frappe.set_route("List", "assessment-form",{
"participant":frm.doc.participant,
});
});
button1 is the name of the button field