Link field does't hold data

Hello All,

I have written script for fetching child table data from one doctype to other and it was working fine before. But today i have tested it, it will fetch data from another child table but it’s shows blank filed in link field which used to select another doctype.

Here is my Code and i did not make any changes since last commit.

frappe.ui.form.on(“Weigh Bridge”, “body_type”, function(frm) {
frappe.model.with_doc(“Body Template”, frm.doc.body_type, function() {
var tabletransfer = frappe.model.get_doc(“Body Template”, frm.doc.body_type)
$.each(tabletransfer.material, function(index, row){
d = frm.add_child(“material_table”);
d.material_name = row.material_name;
d.material_weight = row.material_weight;
d.moisture = row.moisture;
d.net_weight = row.net_weight; =;

	var tabletransfer1 = frappe.model.get_doc("Body Template", frm.doc.body_type)
	$.each(tabletransfer1.chemical_details, function(index, row){
		d = frm.add_child("chemical_table");
		d.chemical_name = row.chemical_name;
		d.chemical_weight = row.chemical_weight; =;
	var roundof_moisture = frm.doc.moisture_weight;
	cur_frm.set_value ("moisture_weight", roundof_moisture.toFixed(2))


Here, i can able to fetch data but link field didn’t show selected doctype.

What is the wrong with this ?