Set defualt row for child table

How can I define some default rows for a child table in the parent doctype?

I found this way

frappe.ui.form.on('Sale Order',  {
    setup(frm) {
        let row = frm.add_child('sale_order_added_cost', {
            added_cost:"Departure cost",
            amount: 2
        });
    frm.refresh_field('sale_order_added_cost');
        
    }
})