Regarding child table fetching

i created one child table doctype.then i created another doctype in which i want to pull data automatically from child table .can you help me please with custom script code?

Refer to this wiki page. Hope this helps, thanks

Dear sir,
This is not working
frappe.ui.form.on(“DocTypeB”, “Trigger”, function(frm) {
frappe.model.with_doc(“DocTypeA”, frm.doc.trigger, function() {
var tabletransfer= frappe.model.get_doc(“DocTypeA”, frm.doc.Trigger)
$.each(qmtable.ChildTableA, function(index, row){
d = frm.add_child(“ChildTableB”);
d.field1 = row.fielda;
d.field2 = row.fieldb;
Please help me with modified one