How to validate before workflow action

so i have this child table. What i want to do is check if all the fields are filed before i can approve it if not all fields are filled it should throw a frappe.throw mesage

Hi @John_Dagpin,

Check this and apply with your variable:

frappe.ui.form.on(“Parent Doctype”, “validate”, function(frm, cdt, cdn) {
$.each(frm.doc.table_name || [], function(i, d) {
if(!d.child_table_field1 && !d.child_table_field2) {
frappe.msgprint(‘’ Please fill up all details");
validated = false;

And also set your condition in if statement

Thank You!

1 Like

willl try this