I have an child table in my doctype its consists of 10 rows i need to validate every row that the checkbox is enabled r not if its not i wont allow to submit …
here is my code it oly viewing the single row not all! can u guys help me to sort out this problem…
for i in self.get("items"):
if i.label_printed == 0:
frappe.throw('Err")
If this condition is required for ALL cases (All item codes all situations) then, simply keep it mandatory no need for this code.
Then try like this:
invalid_rows = []
for i in self.get("items"):
if not i.label_printed:
invalid_rows.append(str(i.idx))
#after loop ends
if invalid_rows:
row_string = ','.join(invalid_rows)
frappe.throw("Label Printed not checked in rows {0}".format(row_string))