Hi,
I want to retrieve exchange_rate field from Currency Exchange doctype where “from_currency” field in the Currency Exchange= currency_name (field in the customized doc( journal entry )
and “to_currency” field in the Currency Exchange doc =row.account_currency( field in child table (Journal entry account doc
I tried this script but it didn’t work , please help me,
frappe.ui.form.on(‘Currency Exchange’,{
'exchange_rate':function(frm1) {
cur_frm.set_query(frm1.doc.exchange_rate, function() {
return {
"filters": {
"from_currency": frm.doc.currency_name,
"to_currency": row.account_currency,
}
}
})
console.log(frm1.doc.exchange_rate);
}})