Data not saved in web form child table

Any idea ?

Is your site running its saying 500 internal server you may check logs on the server like your DB services other services are working or not.Please check Server logs for more details

No site is working correctly and data is saving on database except child table.

@KS_Deal, A workaround is to add a client script and add a validate handler. Then set the property of frappe.web_form.doc[CHILD_TABLE_FIELDNAME] = frappe.web_form.get_values().CHILD_TABLE_FIELDNAME; See the example below where my child table field name is ā€œparametersā€:

frappe.web_form.validate = () => {
let data = frappe.web_form.get_values();
frappe.web_form.doc[ā€˜parametersā€™] = data.parameters;//set this here otherwise the child table values will not save
return true; //Make sure you return true else data will not save
};

1 Like

Thank you, this worked for me.

Just note that the client script should be filled out on the actual web form, not as a custom script.

See the below example on the Job Application Web Form for the child table language.

frappe.web_form.validate = () => {
   let data = frappe.web_form.get_values();
   frappe.web_form.doc['language'] = data.language;
   return true;
};

4 Likes

@alkuhlani

this is the solutions

2 Likes

can plzz snd the js file or code

@Saad_Genirex

Write this script on web Form in Client Script Section

frappe.web_form.validate = () => {
let data = frappe.web_form.get_values();
frappe.web_form.doc[ā€˜Your_Child_Tableā€™] = data.Your_Child_Table;

return true;
};