Bug in the child table in v7

Hi Experts ,

I am facing a problem in v7 , the child table’s first row appears when entering into the doctype , I am running a script to filter the link in a child table by changing the field in the parent doc , the script does not work for the first row , everytime I need to delete the first row to make my script work , since it opens automatically when I open the doctype. Absolutely no problem with v6.27 , but I’m now on v7 , experts please help me with a solution .

Thanks in advance

@srinivasragav write a condition and skip that row.

1 Like

Thanks for responding sir , could you just hint me with an example of how to do that ? Is there any way to make it like , unless I click on the add row button , the first row should not appear .

Thanks in advance

Share your script.

1 Like

Thanks a ton for your swift response sir , here is my script , this script works like a charm expect for the fact that I need to delete the first row and add things in the second row ,

frappe.ui.form.on("BOM", {
item: function(frm) {
frappe.call({
"method": "frappe.client.get_value",
"args": {
"doctype": "Item",
"filters": {"item_code": cur_frm.doc.item},
"fieldname": ["percnt_carbon_min","percnt_nik_min","percnt_man_min","percnt_chro_min","percnt_sil_min","percnt_moly_min","percnt_sul_min","percnt_van_min","percnt_phos_min","percnt_cob_min","percnt_cop_min","percnt_nit_min","percnt_carbon_max","percnt_nik_max","percnt_man_max","percnt_chro_max","percnt_sil_max","percnt_moly_max","percnt_sul_max","percnt_van_max","percnt_phos_max","percnt_cob_max","percnt_cop_max","percnt_nit_max"]
}, 
callback: function(r) { 
cur_frm.set_query("item_code", "items", function(doc, cdt, cdn){
return {
"filters": {
"percnt_carbon_min": [">=",r.message.percnt_carbon_min],
"percnt_carbon_max": ["<=",r.message.percnt_carbon_max],
"percnt_nit_min": [">=",r.message.percnt_nit_min],
"percnt_nit_max": ["<=",r.message.percnt_nit_max],
"percnt_man_min": [">=",r.message.percnt_man_min],
"percnt_man_max": ["<=",r.message.percnt_man_max],
"percnt_chro_min": [">=",r.message.percnt_chro_min],
"percnt_chro_max": ["<=",r.message.percnt_chro_max],
"percnt_sil_min": [">=",r.message.percnt_sil_min],
"percnt_sil_max": ["<=",r.message.percnt_sil_max],
"percnt_moly_min": [">=",r.message.percnt_moly_min],
"percnt_moly_max": ["<=",r.message.percnt_moly_max],
"percnt_sul_min": [">=",r.message.percnt_sul_min],
"percnt_sul_max": ["<=",r.message.percnt_sul_max],
"percnt_van_min": [">=",r.message.percnt_van_min],
"percnt_van_max": ["<=",r.message.percnt_van_max],
"percnt_phos_min": [">=",r.message.percnt_phos_min],
"percnt_phos_max": ["<=",r.message.percnt_phos_max],
"percnt_cob_min": [">=",r.message.percnt_cob_min],
"percnt_cob_max": ["<=",r.message.percnt_cob_max],
"percnt_cop_min": [">=",r.message.percnt_cop_min],
"percnt_cop_max": ["<=",r.message.percnt_cop_max],
"percnt_nit_min": [">=",r.message.percnt_nit_min],
"percnt_nit_max": ["<=",r.message.percnt_nit_max],
"item_group": "Raw Material"
}
}
});
}
});

}
});

Please help me.

Thanks in advance

@rmehta Sir , I shared the script is there any solution for my problem ? Or is there a way to go back to v6.27 ?

Thanks in advance

Sir , @rmehta Please help me . How to make the child table display the first row only upon clicking the add button . Please it will really help many who are running scripts .

Please help

Related GitHub issue:

1 Like

Is there any fix available for this ?