diff --git a/Community-Developed-Custom-Scripts.md b/Community-Developed-Custom-Scripts.md index f9eb4da..8a70dc2 100644 --- a/Community-Developed-Custom-Scripts.md +++ b/Community-Developed-Custom-Scripts.md @@ -89,14 +89,15 @@ The following fetches all entries in a child table from another document. ``` 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; -cur_frm.refresh_field("ChildTableB"); -}) + 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; + cur_frm.refresh_field("ChildTableB"); + }); + }) }); ``` ***