I am having a select-type field category and I want data from another doctype on change of this field.
This is what I have tried so far
cur_frm.cscript.category=function(frm){
frappe.call({
'method': 'frappe.client.get_list',
'args':{
'doctype': 'Morning Updates',
'fields': service,
'filters': {'category':cur_frm.doc.category}
},
async: false,
callback: function(r)
{
console.log(r.message)
}
});
}
For first time it is giving the list, but let say I accidently selected another option and now want to select the right field, then for second time it is giving error.