mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-12 17:23:38 +00:00
Updated Community Developed Custom Scripts (markdown)
@@ -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");
|
||||
})
|
||||
});
|
||||
```
|
||||
});
|
||||
Reference in New Issue
Block a user