Hi,
I am trying to add a custom query to a script report filter “js” file. The code I am trying to use is as below but obviously its not working. Please let me know how to correct this code:
frappe.query_reports["Item Report"] = {
"filters": [
{
"fieldname":"bm",
"label": "Base Material",
"fieldtype": "Link",
"options": "Item Attribute Value",
"get_query":
frappe.call({
'method': 'frappe.client.get_list',
'async': false,
'args': {
'doctype': 'Item Attribute Value',
'filters': ['parent', '=', 'Base Material'],
'fields': ['attribute_value']
},
'callback': function(res){
res.message.attribute_value
}
});
}
]
}