Hidden the add row button in child tabl

i need to hidden the add row button in child table

Hi @mohamed_ibrahim,

Please apply the client script.

// Syntax
frappe.ui.form.on('Your DocType', {
    refresh: function(frm) {
        // set your table field name
        frm.set_df_property('your_table_field_name', 'cannot_add_rows', true);
    }
});

// Example
frappe.ui.form.on('Sales Order', {
    refresh: function(frm) {
        frm.set_df_property('items', 'cannot_add_rows', true);
    }
});

Thank You!

2 Likes

@NCP, its working fine but i need to disable the delete the row as well so for i am just make it as read_only.the above commend give the new property name cannot add row and we set to true right?
and i need to know for disable the delete row are you know about it?
Thanks in advance :slight_smile:

Use it like:

frm.set_df_property('your_table_field_name', 'cannot_delete_rows', true);

Thanks!

2 Likes