Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

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