If you don’t pass in name , or name is None, AND you don’t pass in a filters arg, the method looks for a doctype of type Single - hence the message “Qualification Qualification not found.”
You must ensure that you are passing a name arg into your call to frappe.client.get to get a non-single doctype. You could bind the method to “certificate_required” to ensure that there is a value to pass in, and I would also validate that before the call with something like this…
frappe.ui.form.on("Qualification Entry", "qualification", function(frm) {
// consider using "certificate_required" above instead of "qualification" -
// this helps ensure you get a value passed in. You also should validate with
// comparison to null -> != instead of !== to allow js to do type conversions
if(frm.doc.certificate_required != null) {
frappe.call({
"method": "frappe.client.get",
args: {
doctype: "Qualification",
name: frm.doc.certificate_required
},
callback: function (data) {
frappe.model.set_value(frm.doctype,
frm.docname, "certificate_required",
data.message.certificate_required
)
}
})
} else {
// logic here to do something (maybe) if there is no value in your
// "certificate_required" field.
}
});
ty @alec_ruizramon1 for your response.
I need the call fired when the user makes a selection in the linked field qualification. That’s why I set "qualification" in first line. If I change it to certificate_required then the event fires on check / uncheck of certificate_required field which is not the proper action.
As far the certificate_required field, this is actually a hidden field and its status (checked / unchecked) depends on the returning value of the Qualification.certificate_required field (the other docType named Qualification, field certificate_required)
It seems to me that I set the parameters correct but I am getting that strange error