Updated Community Developed Custom Scripts (markdown)

Christopher G. Purbaugh
2016-08-17 14:21:54 -04:00
parent 6d963519db
commit 1c276f5955

@@ -81,4 +81,22 @@ frappe.ui.form.on("Dropbox Backup", "refresh", function(frm){
})
}
});
```
```
### Fetch child table
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");
})
});
```
});