Restricting no.of rows

is there any way for restricting no.of rows to be added when using child tables

@hereabdulla,

You can write the function that will raise an error to restrict the number of row on validate hook.

Thanks, Makarand

is there any way to hide add new row option when rows reached a limit?

Hi,

Am interested as well - to understand if it is possible to hide add new row button after a certain number of rows have been added.
Thank you.

Yes, try the toggle_enable method to make the table readonly

e.g. cur_frm.toggle_enable('childtable_fieldname', false)

If i’m using the toggle_enable method then the entire table is being hidden.[quote=“makarand_b, post:5, topic:13400, full:true”]

Yes, try the toggle_enable method to make the table readonly

e.g. cur_frm.toggle_enable('childtable_fieldname', false)
[/quote]

Yes, Only if, you don’t have any child table entry. It is default frappe functionality. If any field value is None or empty and the field is a readonly field then the field is kept hidden.

1 Like

not working