The CreatorCon Call for Content is officially open! Get started here.

Set read only

keerthana
Tera Contributor

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:

1 ACCEPTED SOLUTION

Community Alums
Not applicable

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');
}
}

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

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');
}
}

which table  select? user or incident

Nilesh Pol1
Giga Guru

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

NileshPol1_0-1692705491413.png

NileshPol1_1-1692705551134.png

please mark as helpful if satisfied with this answer.

 

Thank you.