- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:44 AM
if the user have the requried role than only he can access the email field avaliable in incident form otherwise email field become read only for him.
how to find user have a role using script:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:47 AM
Hi @keerthana ,
ACL's are best at allowing people to see the data, edit or otherwise manipulate the data. If you just want it not to show up for people with a given role, you can use a client script to show/hide the field. Below is an example on how to do that;
function onLoad() {
var isAdmin = g_user.hasRole('admin');
//console.log("isAdmin: " + isadmin);
if (isAdmin == true) {
g_form.setDisplay('staff_type', 'true');
} else {
g_form.setDisplay('staff_type', 'false');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:47 AM
Hi @keerthana ,
ACL's are best at allowing people to see the data, edit or otherwise manipulate the data. If you just want it not to show up for people with a given role, you can use a client script to show/hide the field. Below is an example on how to do that;
function onLoad() {
var isAdmin = g_user.hasRole('admin');
//console.log("isAdmin: " + isadmin);
if (isAdmin == true) {
g_form.setDisplay('staff_type', 'true');
} else {
g_form.setDisplay('staff_type', 'false');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:53 AM
which table select? user or incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:59 AM
Hi @keerthana
You can create ACL of type: record, operation: write, select unique field in name and add requires role that you want allow write access for email field on incident form.
PFA
please mark as helpful if satisfied with this answer.
Thank you.