Hi,
I am having trouble setting query on s_warehouse in Stock Entry Detail. The goal is to have a query filtered using a field in child table name “source_warehouse”.
frappe.ui.form.on(“Stock Entry Detail”, “source_warehouse”, function(frm, cdt, cdn) {
var child = locals[cdt][cdt];
msgprint(“I am here”);
frm.fields_dict[‘items’].grid.get_field(“s_warehouse”).get_query = function() {
return{
filters:[
[‘parent_warehouse’, ‘=’, child.source_warehouse]
]
}
}
});
Am i missing something?