How to hide/remove the delete button from any child table?

Hi @Prasant_Pant,

Please check the syntax.

frappe.ui.form.on('Your DocType', {
    refresh: function(frm) {
       frm.set_df_property('child_table_name', 'cannot_add_rows', true); // Hide add row button
       frm.set_df_property('child_table_name', 'cannot_delete_rows', true); // Hide delete button
       frm.set_df_property('child_table_name', 'cannot_delete_all_rows', true); // Hide delete all button
    }
});

Please set your doctype name and child table name in the script according.

Please check it reference.
https://github.com/search?q=repo%3Afrappe%2Ferpnext%20cannot_add_rows&type=code
https://github.com/search?q=repo%3Afrappe%2Ferpnext+cannot_delete_rows&type=code

I hope this helps.

Thank You!

10 Likes