Set all fields to read only when active = false without affecting related list edit button

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 04:41 PM - edited 11-15-2022 04:45 PM
Hi all, I have a custom app that I am trying to set all fields on the form as ready only when the ticket is closed - ie. active = false. This is successful using a write ACL with the condition of active = true:
But, when this condition is set on the ACL, the edit button on the related list tab of the same table disappears for the 'user' role, and is only visible for admins. I have checked and confirmed that the omit edit button is not checked for this list control, and there is no impact to the new button if the ACL condition is or is not there. When the ACL condition of active = true is removed, the edit button is visible again, but of course all fields are editable even when the ticket is inactive.
How do I achieve both, as one cancels out the other?
- set all form fields to read only when ticket is inactive
- enable edit button on related list
Many thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 01:48 AM
Hello Emma,
Seems like a problem since NewYork version and the recommendation from SN based on the KB0813148 is not working for variables on the Form. Were you able to solve this issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2023 05:01 PM
Hi Lubos, I was able to solve it but had to use ACL's, the client script didn't work in my case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2022 02:48 AM
Hi Emma,
Please use following code to make all fields read-only(Client Script)
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
Regarding the Edit button make sure users have required role you chosen in ACL. Also find out if other ACLs not overwrites this rule.