Hello,
I am hoping that I could get some help on this.
I have created a custom Frappe page, which displays a child DocType (refer attached images below- not all fields are displayed in the image).
This table has many dependent fields which fetches data from another DocType called ‘Step’ - it has fields like Step Name, Department, Step Type, etc. This DocType is basically used for associating a step name with all the other parameters like department, step type, etc.
I am facing two issues and would like to seek answers for them:
-
When I want to add a new step, I would click on ‘Add Row’ and then get a blank row first. The field step is a link field, and hence would first choose a step from the list. Ideally, once I choose a step, the department and step type fields should get auto populated (for which fetch_from is enabled in the DocType settings to fetch from the Step Doctype). The field status, is a link field (linked to another DocType), and gets filtered based on step type. All this currently shows up once I choose a step and hit save. But I would like all this to happen in the UI itself.
-
Is it possible for us to apply field permissions to only a few records based on certain conditions in a Frappe page? For instance, our custom app has roles that are the same as what we see here in department. So, those logged in with the same department role should only be able to edit the status of those corresponding records. Is it possible to achieve this with the ‘read_only’ or ‘read_only_depends_on’ fields in a Frappe page? Currently, our approach is that anyone can change the value in the UI. On hitting ‘Save Changes’, the code will check if they are authorized to edit and if they are not, it will throw a dialog box saying that you are not permitted to change, but the changed value does not get reverted back in the UI (the back-end is solid though, no issues at all). How to revert the changed status values for unauthorized changes in the UI in a Frappe page if this approach is used?