Hi There,
We have setup a new doctype called ‘Compliance Record’. It has few fields like employee, compliance type, compliance text and acknowledgement date (mandatory field) . Each employee needs to acknowledge this compliance form once a year by entering acknowledgement date. Few questions:
- How do we make entire form read-only once an employee has selected acknowledgement date and clicked on Save. We want to do this because once the employee had acknowledge the form we don’t want them to change anything.
Currently I am hiding the save button to tackle the above using below script. We also wants each field to be read-only and do this by making the entire form read-only rather setting each field to read-only in the code.
frappe.ui.form.on("Compliance Record", {
refresh: function(frm) {
if (!frm.is_new()) {
frm.disable_save();
}
}
});
- How do make sure that they don’t fill another form for the same year? should we use validate method on the server side to validate this?
Thanks.