How i can restrict the deletion of row in dialog child table

here how i can hide r restrict the delete and delete all buttons.

Can you share the code ?

If you want to hide delete or delete all button
try this
frm.fields_dict[ā€˜child_table_nameā€™].grid.wrapper.find(ā€˜.grid-remove-rowsā€™).hide();

thanks for sharing but doesnt workā€¦

in a dialog how we can restrict those things

need to bulidā€¦

You can add frappe.user.has_role(ā€œBlablablaā€)

add in the function delete and delete all button

i m trying these buttonsā€¦

Thanks fa sharing but not worked

Try this in your Dialog child table declaration

{
fieldname: ā€œtrans_itemsā€,
fieldtype: ā€œTableā€,
label: ā€œItemsā€,
cannot_add_rows: 1,
cannot_delete_rows : 1,
in_place_edit: false,
reqd: 1,
read_only: 1,
data: this.data,
get_data: () => {
return this.data;
},
fields: fields
},

1 Like

Thanks for sharing this sammer,
We can use this for custom dialog

yes u can