// Attach a handler to the 'Sales Expense Liquidation' form
frappe.ui.form.on('Sales Expense Liquidation', {
// Event triggered when the form is refreshed
refresh(frm) {
// Check if the form is for a new document
if (frm.is_new()) {
// Add the first row to the 'header' child table and set its value
let row1 = frm.add_child("header");
row1.particulars = "Date";
// Add the second row to the 'header' child table and set its value
let row2 = frm.add_child("header");
row2.particulars = "Travel From";
// Add the third row to the 'header' child table and set its value
let row3 = frm.add_child("header");
row3.particulars = "Travel To";
// Refresh the child table field to reflect the added rows in the UI
frm.refresh_field("header");
}
}
});
This is an example. check that the fields are correct, etc and modify the code to your liking