Why is this Client Script not working?

I have built custom DocType.

In this I am trying to update a field in all the rows of a Child Table.

I am using following Client Script

frm.doc.operations.forEach(op_data => { 
                console.log(op_data.operation);
               op_data.qty_to_mfg = UserQty;
            });

The loop is not getting executed. Why?

Regards,

@yogeshvachhani Check where did you put your code.
Example:

frappe.ui.form.on('Doctype',  {
    refresh: function(frm) {}
});

After your loop you must refresh the child table field.

frm.refresh_field('operations')
1 Like

Thanks for the tip.

I was missing that one line.

Regards,