Within same Doctype Copy of Fields from one Child Table to another child Table

Doctype A
Child Table 1 (Link field x; Trigger Field xx)
Child Table 2 (Link field y; Comparison field yy)

  1. When the trigger field xx is updated
  2. Check in table 2 for row where x=y
  3. For row x=y ; copy yy to xx

The following reference is not working:

This solved the problem, handled the case as part of validate.

frappe.ui.form.on(“DOCTYPE”, {
validate: function(frm){
frm.doc.items.forEach(function(item){ //Target Table
frm.doc.hardwareset_bom_mapping_table.forEach(function(hsbom){//Source Table
if(item.hardware_set == hsbom.hardware_set) //Matching/Comparing field in Source & Target
{
item.bom_no = hsbom.bom; //Source table field copied to Target field
}
});
});
}
});