I have a doctype that contains two identical child tables with different fieldnames. I want both child table to act identically, including my custom functionality. Instead, my on_change events are only triggering on the first field. This is how I’ve set up the code:
frappe.ui.form.on('Childtable Doctype', {
my_field: (frm, cdt, cdn) => {
console.log('logs only when the first child table my_field is triggered');
},
If I change the value in with my_field for the first child table, I see the message logged to the console. However, if I interact with the second child table, nothing happens.
Based on how the database respects the fieldname of the Child Doc, I expected the form events to work the same way - the functionality would either be attached to both forms, or there would be a way to explicitly to attach it to both forms.
How can I get my on_change events to work on the second child table?