Hi Everyone,
Is there any way to put validation rules on the child table using script.
I am doing some calculation in Expense Claim Form by adding few custom fields km and claim_amount.
Now, I want that the claim amount should not exceed the sanctioned_amount.
Below is my code, I am using for calculations.
frappe.ui.form.on("Expense Claim Detail","claim_amount", function(frm, cdt, cdn) {
var d =locals[cdt][cdn]
var item=frappe.get_doc(cdt,cdn);
if(d.expense_type=="Local Conveyance"){
frappe.model.set_value(cdt, cdn, "claim_amount", item.km*item.rate);
cur_frm.refresh_fields();
}
});
Regards
Ruchin Sharma