Hello,
I have created a Maintenance DocType. I made a custom script for filtering machines from their Category.
I need Machines field to be refreshed based on the Category field .
In the below first image I have selected Machines from 3PL Machinery.
If I change the Category , the machine remains the same.
Thank you
when I change the category field it remains the same
frappe.ui.form.on("Maintenance",{
refresh: function(frm){
frm.set_query("category", function(){
return {
"filters": [
["MList", "check", "=", "1"]
]
};
});
}
});
frappe.ui.form.on("Maintenance",{
refresh: function(frm)
{
frm.set_query("machine", function(){
return {
"filters": [
["MList", "category", "=", frm.doc.category, ],
]
};
});
}
});