Child Table Customization

I am trying to modify a child table (specifically Quality Inspection parameter table in Item doctype) . I have added some fields but the field don’t show in main form (though fields are there in child doctype).
Also , custom scripts are also not working on child tables . whenever i try to set a child table field i get 'field not found ’ error message . :

Please help .

You need to set in grid view and column value to set the field width, just keep in mind sum of column value must be <= 10.

@ajaygupta, Can you please share your script.?

frappe.ui.form.on(“Item Quality Inspection Parameter”, {
test_parameter: function(frm,cdt,cdn) {
var d=locals[cdt][cdn];
frm.add_fetch(d.test_param,‘test_parameter’,d.specification);
refresh_field(‘quality_parameters’);
}
});

I have created a custom doctype ‘Test Parameters’ which has a field ‘test_parameter’ which i want to fetch to ‘specification’ field in “Item Quality Inspection Parameter” which is a child table in Item doctype

Thanks for helping me

Dear JoEz , I am new to ErpNext . I am not being able to follow you. Would you please explain with some example or would you please lead me to some tutorial on this. Plz. Thanks for you reply

Changing column value only increases/ decreases width of existing columns . but custom added fields dont show up.

I am able to solve the second part of the problem (custom script with child tables) . The script that worked for me is ;

frappe.ui.form.on(“Item Quality Inspection Parameter”, {
test_param: function(frm,cdt,cdn) {
var d=locals[cdt][cdn];
var test = d.test_param;
frappe.call({
method: “frappe.client.get”,
args: {
doctype: “Test Parameters”,
filters: {“test_parameter”:test}
},
callback: function(r) {
d.specification = r.message[“test_parameter”];
d.criteria = r.message[“criteria”];
refresh_field( ‘quality_parameters’); }
});
}
});

so far so good :smile:

The First Problem still exists . Custom fields not showing in child table . Plz help :slight_smile:

1 Like

Problem solved :smile: . Selecting ‘In List View’ for the fields i wanted to show did the trick :smile:

1 Like