Hi, How to fetch the same child table doctype value to Dialog box table of same doctype.
This, is my code.
const tablee_2 = [{
fieldname: "q_block_no",
fieldtype: "Data",
in_list_view: 1,
label: "Q. Block no"
},
{fieldname: "qg_length",
fieldtype: "Data",
in_list_view: 1,
label: "QG. Length"
},
{fieldname: "qg_width",
fieldtype: "Data",
in_list_view: 1,
label: "QG. Width"
},
{fieldname: "qg_hight",
fieldtype: "Data",
in_list_view: 1,
label: "QG. Hight"
},
{fieldname: "qgcbm",
fieldtype: "Data",
in_list_view: 1,
label: "QGCBM"
},];
var dialog = new frappe.ui.Dialog({
title: __('Custom Size Dialog'),
fields: [
{fieldtype: "Section Break"},
{"fieldtype": "Heading" , "fieldname": "form_name" , "label": "Form Name", "options": ""},
{"fieldtype": "Link" , "fieldname": "link_1" , "label": "", "options": "value"},
{"fieldtype": "Heading" , "fieldname": "blocks_details" , "label": "Blocks Details", "options": ""},
{fieldtype: "Table" , fieldname : "table_2" , label: "", options : "Block Confirmation",
fields: tablee_2},
{"fieldtype": "Data" , "fieldname": "qg_cbm" , "label": "QG. CBM", "options": ""},
],
link_1:function(){
if(frm.doc.link_1){
frm.clear_table('table_2');
$.each(source_doc.table_1,function(index, source_row){
var addchild = frm.add_child("table_2");
addchild.q_block_no = source_row.q_block_no;
addchild.qg_length = source_row.qg_length;
addchild.qg_width = source_row.qg_width;
addchild.qg_hight = source_row.qg_hight;
addchild.qgcbm = source_row.qgcbm;
frm.refresh_field('table_2');
});
var ttl_qg_cbm = 0;
$.each(frm.doc.table_2, function(i, d) {
ttl_qg_cbm += flt(d.qgcbm);
});
frm.doc.qg_cbm = ttl_qg_cbm;
}
},
primary_action: function(){
d.hide();
frappe.show_alert(d.get_values());
}
});
dialog.show()
This is the output screen, Am getting for the above code. After selecting the form name the table values are not getting displayed.
How to achieve this?
Thank you in advance.