Hide a field in a form for certain users.

Community Alums
Not applicable

Hi Team,

I have a requirement on Risk Event table in GRC: Advanced Risk scope.

As a Risk manager and Risk user, I want to hide a 'xyz' field and this field is created in GRC: Compliance Case Management Scope.

 

Code:


function onLoad(){
var userRole=g_user.hasRole('sn_risk.manager');
if(userRole == true){
g_form.setDisplay('xyz',false);
}else{
g_form.setDisplay('xyz',true);
}
}

 

Thanks,

Monish

1 REPLY 1

Wessel van Enk
Tera Guru
Tera Guru

Hi,

This is one of the options, but you can also consider a read ACL.
If you create an ACL with the following conditions, it should work as well.

 

Type = Record

Operations = Read

Name = Risk Event table.xyz (First field = table, second field = field)

Roles = sn_risk.manager

 

Something like this:

Wessel_0-1730211617880.png

 

Hopefully this helps.