I have Custom Script for Form like this:
frappe.ui.form.on('Key Results', {
refresh(frm) {
// your code here
frm.doc.current_progress = flt(frm.doc.current) / flt(frm.doc.target) * 100;
}
})
But I found that frm.doc.current value is the value stored in Database, not in submitting form. For example:
- Old current value is 1, target is 2. Update new current value to 0, progress is 50 (because it use 1/2 instead of 0/2)
Is there a way to get data in submitting form?