Prevent duplicate entries in child table

How can I prevent duplicate entries from being selected when using the ‘Add Multiple’ button in the child table?

frappe.ui.form.on(‘Training Attendance Entries’, {
refresh: function (frm) {
frm.get_field(“attendees”).grid.set_multiple_add(“employee”);
}
});
In my code, I am using the Add Multiple button to select multiple employees in the attendees child table of the Training Attendance Entries doctype.

Reference: Users cannot add rows with the same item twice. If do, then show an error message and remove the row/item from row - #2 by kid1194

1 Like