How to access child table field in js function?


I need to get child table values as object and I need to loop that object. I used frm.doc.child_table_field. But its shows undefined. How to solve this problem?

Hi Priya,

Its not directly print child table values so you can use for loop it will be return the values

Hi @Jecintha ,

How to loop particular form child table values in js function?

Pls refer the below ex code,
frm.fields_dict.child_table_name.grid.grid_rows.forEach((row) => {
if (row.doc.child_table.field){
//your code here

Alternative loop

for (var i = 0; i < cur_frm.doc.child_table.length; i++) {
if (cur_frm.doc.child_table[i].child_table_field) {
//your code here