Adding a Javascript in a Child Table

Good Day!! I’ve created a child table and wants to add functionality using javascript and notice like to main table when creating a doctype of the child table it has no JS file so I’ve create a javascript file and follow the Tutorial on how to create an App but sadly It is not working, is there a way to fix or proper documentation on frappe development

Thanks

@sam_salvador can’t help unless you share what you have done

@sam_salvador

Its better if you share your objectives and code.

Anyways, you can put custom script for child table in parent form.

Hi @rmehta,

Right now i’ve found a way to code a javascript in the Child Table, and my objective is this we created a New app Logistics and in that app there’s a seperate Sales Order, and in every sales order user can add a Trip ticket number/s which is the child table and when a user select a Trip Ticket Number an event will triggered that will populate the fields Details which is in a html field type but right now It takes two/three selection in to the populate said fields here is my sample pics

Here is my Code in JavaScript
`frappe.provide(“erpnext”);
frappe.require(“assets/erpnext/js/controllers/stock_controller.js”);

erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
_calculate_taxes_and_totals: function() {
this.get_routes();
},
get_routes: function() {
if (this.frm.doc[“items”][this.frm.doc[“items”].length-1].trip_ticket){
item = this.frm.doc[“items”][this.frm.doc[“items”].length-1]
return frappe.call({
method: “logistics.logistics.doctype.logistics_sales_order.logistics_sales_order.get_destination”,
args: {
“trip_ticket”: item.trip_ticket
},
callback: function(r, rt) {
if(r.message) {
item.details = r.message;
refresh_field(item.details);
}
},
});
}
},
})
`