Open new row automaticaly in sales team table

in Sales invoice is see first row open automatically in sales item child table but in Sales team not open first row automatic
i want to after make new sales invoice show first row in sales team table automatically


Thanks

Hi @Webbo_Egy,

Please apply it.

frappe.ui.form.on('Sales Invoice',  {
    refresh: function(frm) {
        if (frm.doc.__islocal) {
            var row = frm.add_child('sales_team');
        }
    }
});

Then reload and check it.
When you create a new sales invoice then will show the first row.

Thank You!

2 Likes

Thanks Its Working Like A Charm
Best Regards

In parent doctype ‘OFFER FEIPL EX’ there is a child table doctype ‘Calculation’

the net_total field on OFFER FEIPL EX is always fetch on the first row of child table in fieldname ‘amount’.

When i refresh the net_total on the OFFER FEIPL EX form, the first row (in which the amount is fetched) is not updated but rather it adds new row with new value. Is there any way we can update only first row on child table when field on parent doctype is updated ?