hello I want to filter item_code in child table based on custom field is_purchase / is_sold at item master doc. as it was in V6
what custom scrip should i use and where i must add it?. thanks in advance.
hello I want to filter item_code in child table based on custom field is_purchase / is_sold at item master doc. as it was in V6
what custom scrip should i use and where i must add it?. thanks in advance.
this is the scrip im trying to use without luck cur_frm.fields_dict[“item_code”].grid.get_field(“item_code”).get_query = function(doc){
return {
filters:{
“is_purchase_item”: “1”
}
}
}
finaly got it the code is
frappe.ui.form.on(“Purchase Order”, “refresh”, function(frm) {
cur_frm.fields_dict[‘items’].grid.get_field(‘item_code’).get_query = function(doc, cdt, cdn) {
return {
filters:[
[‘is_purchase_item’, ‘=’, ‘1’]
]
}
}
});