How to fetch data from one child table to another child table using trigger from first child table

frappe.ui.form.on("[TARGETDOCTYPE]", {

“[TRIGGER]”: function(frm) {
frappe.model.with_doc("[SOURCEDOCTYPE]", frm.doc.[TRIGGER], function() {
var tabletransfer= frappe.model.get_doc("[SOURCEDOCTYPE]", frm.doc.[TRIGGER])
$.each(tabletransfer.[SOURCECHILDTABLE], function(index, row){
var d = frm.add_child("[TARGETCHILDTABLE]");
d.[TARGETFIELD1] = row.[SOURCEFIELD1];
d.[TARGETFIELD2] = row.[SOURCEFIELD2];
frm.refresh_field("[TARGETCHILDTABLE]");
});
});
}
});

Code above is working as per logic, how to use trigger from child table.
i have two child tables in one doctype. (fg_items & rm_items) as and when the data in fg_items get filled, i want to fill raw materials required in rm_items table. Could anyone help me in this.