How to make 14 Fields editable only when state is 'Monitor' & User is part of 'XYZ' group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 11:06 PM
Hi all,
I have to work on below requirement.
"How to make 14 Fields editable only when state is 'Monitor' & User is part of 'XYZ' group"
But what should be my approach here. If I go with ACL I will have to write ACL for each field. OR Should I go with Client script to achieve the same. What is a best practice here?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 11:19 PM - edited 07-02-2024 11:22 PM
Hello @Obito ,
Client script would be a good option in this case.
but you need to use GlideAjax in this case to check if user is part of group or not.
refer below thread for GlideAjax example.
Then simply you set the fields to editable.
If you want to set all the fields to editable
then refer below script
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], false); // will make field to editable
}
You can script some fields by adding condition.
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
if(fields[i] ! = "<field_name>"){// will skip the fields which you add in if condition
g_form.setReadOnly(fields[x], false); // will make field to editable
}
}
Thanks,
Valmik Patil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 11:28 PM
@Obito
hi.
Using a UI policy is the suggested approach.
However, the condition part is not strong enough to achieve 'User is part of the XYZ group'.
You can have a try to put the condition in the [Execute if true] script."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 02:19 AM