Good morning guys.
please I need your assistance. I have Field A and Field B. I want to compare field A and field B. if field A is greater than field B, the message should show on the screen that “Field A can not be greater than field B” and the form should not be saved.
below is my code;
var field_A = frm.doc.field_a;
var field_B = frm.doc.field_b;
if(field_A > field_B){
frappe.msgprint({
title: __("Invalid Value"),
indicator: "red",
message: __("field Acan not be more than field B"),
});
}else{
frm.set_value(“field_a”, total);
refresh_field(“paid_a”);
}