Hi Everyone,
I have list item (custom) which has two values “Yes”, and “No” which in a child table.
I want to set the value of a list on the basis of a particular condition.
I am using the below code but it works when the condition get satisfy but when the condition doesn’t satisfy it becomes invisible.
frappe.ui.form.on("Expense Claim Detail","expense_type", function(frm, cdt, cdn) {
var d =locals[cdt][cdn]
frm.get_docfield("expenses", "claim_amount").read_only = false;
cur_frm.refresh_fields();
if(d.expense_type=="Local Conveyance")
{
frm.get_docfield("expenses", "vehicle_type").reqd = true;
frappe.model.set_value(cdt, cdn, "invoice_copy", "No");
cur_frm.refresh_fields();
}
else
{
frm.get_docfield("expenses", "vehicle_type").reqd = false;
frappe.model.set_value(cdt, cdn, "invoice_copy", "Yes");
cur_frm.refresh_fields();
}
});
I appreciate, if anyone can help me in this regard.
Regards
Ruchin Sharma