Hi,
Requirement:: Set required true to only opened child doctype
Issue::
- We have manage to set the required true option for child field.
- Required option is getting enable for each child doctype
Screenshot::
- If isActive is false then show the textarea and make it mandatory.
- textarea is getting hide/show based on isActive flag – Success
- set filed mandatory - success
- The filed is getting mandatory for all the child doctype – failed
Code::
var field = frappe.utils.filter_dict(cur_frm.fields_dict["child_doctype_name"].grid.grid_rows_by_docname[cdn].docfields, {"fieldname": "field_name"})[0];
field.reqd = 1;
Reference link:: Enable or Disable a Child Table Field - #17 by ruchin78