I wonder if there is any way to make a child table record mandatory based on parent record.
Actually, my requirement is if user ticks is_purchase_item=Yes then user has to enter supplier and supplier part detail.
Hi @mainul @max_morais_dmm
I have tried mainul code and it is not working whereas I don’t think the max code’s will work for me.
Actually I want to use it for Item Doctype,
while creating an item if user ticks is_purchase_item=Yes, then user has to put the supplier and supplier part no for that item.
frappe.ui.form.on('Item', 'validate', function(frm, cdt, cdn){
if (!frm.doc.supplier_items){
validated = false;
frappe.msgprint('Do you need fill Item Code for Suppliers for Purchase Items')
}
});