how ACCESS CHILD TABLE DATA (Using Custom Script)

Sample code on how to manipulate data in a child table. This type of code falls under the parent form client side script page. And this particular example uses the trigger of a field value being changed then executes some code:

// access the Delivery Stop child tablefrappe.ui.form.on("Delivery Stop", {
// there are different possible event triggers, but `field_name`--replacing this with the actual field name--means when value of a field in the child table is changed; need to include parameters form (frm), child doc type (cdt), and child doctype name (cdn) field_name:function(frm, cdt, cdn){
// declare a collections variable var u = locals[cdt][cdn];
// assign the value of `another_field` with `yet_another_field` when the changevalue event for `field_name` was triggered u['another_field'] = u['yet_another_field'];
// refresh the field of the entire table, note that we are referring to the full table name as declared inside the parent form, in order to reflect the new value frm.refresh_field("delivery_stops"); }});