How to fetch data from saved child table to HTML type field?

perfect . now instead of static row . we need to get data from table and insert them row by row :
in frm.doc.child.forEach , change “child” with your table name .
and repeat the 2 lines of the cell and each time change the value (item_code,uom…)

    frappe.ui.form.on('Fetch Test', {
    	refresh(frm) {
    	var table = document.getElementById("myTable");
    	frm.doc.child.forEach(function(element){
    	   var row = table.insertRow(-1);
    	    //repeat the next 2 lines depending on how many cells you have
    	    var cell1 = row.insertCell(0);
    	    cell1.innerHTML = element.name;
    	    
    	    
    	})
    	
    	}
    })
1 Like