ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Restricting no.of rows


#1

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


#2

@hereabdulla,

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

Thanks, Makarand


#3

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


#4

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.


#5

Yes, try the toggle_enable method to make the table readonly

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


#6

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]


#7

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.


#8

not working