I have a child table called Subject Child and the parent table called Subject Parent. I want to filter the score field in the child table Subject Child.
This is now my initial code but I error occurred “Cannot set property ‘get_query’ of undefined”. Any idea how to filter the field in the child table?
@max_morais_dmm I tried to put it onload but I got this error Uncaught TypeError: this.setup_queries is not a function@jof2jc solution works. I was wondering why its not working what is in ERPNext code?
frappe.ui.form.on("Combine Subject Grade", {
onload: function () {
this.setup_queries();
},
setup_queries: function () {
console.log("im setup queries!");
var me = this;
me.frm.set_query("subject", "combine_subject_score", function (doc, cdt, cdn) {
return {
filters: {
kind: "Child"
}
};
});
}
});