Client script changes value not submitting

Hi,
In Appraisal list the final score is calculated as average of three different scores(KRA, Feedback_score and self_score) But I wrote a client script in which the feedback_score will alone be the final_score

frappe.ui.form.on(‘Appraisal’, {
refresh(frm) {
// your code here
if(frm.doc.avg_feedback_score){
frm.set_value(‘final_score’, frm.doc.avg_feedback_score);
}
}
});

The final score is set correctly but the issue is, It allows only to save the form repeatedly , it does’nt show the submit button

Hi @PranethaaVinoth,

Please use before_save instead of refresh.

Your problem will solved

Thank You!

Thanks for your kind response. But If i use that, the final score takes average of the three values again “frm.set_value(‘final_score’, frm.doc.avg_feedback_score);” this part is not working

Hi @PranethaaVinoth,

Please check the Form Events and set your according to the scenario.

Thank You!