Assignment group feild should be visible for ITAS users

deepika adimu
Tera Contributor

I created one assignment group field in catalogue form level, that feild is to be visible ITAS users 

1 ACCEPTED SOLUTION

Mohan raj
Mega Sage

Hi @deepika adimu,

 

Try this onload client script to hide assignment group variable 

 

Create a display Business rule with script as. Place the below script between function templates in script body.

 

g_scratchpad.grp = gs.getUser().isMemberOf('PASS GROUP NAME HERE');   // ITAS users



Now create the client script as

 

function onLoad() {


  if (g_scratchpad.grp){
g_form.setDisplay('u_assignment_group', true);
}else{
g_form.setDisplay('u_assignment_group', false);
}
}

 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.

Regards,

T Mohan.

View solution in original post

3 REPLIES 3

Mohan raj
Mega Sage

Hi @deepika adimu,

 

Try this onload client script to hide assignment group variable 

 

Create a display Business rule with script as. Place the below script between function templates in script body.

 

g_scratchpad.grp = gs.getUser().isMemberOf('PASS GROUP NAME HERE');   // ITAS users



Now create the client script as

 

function onLoad() {


  if (g_scratchpad.grp){
g_form.setDisplay('u_assignment_group', true);
}else{
g_form.setDisplay('u_assignment_group', false);
}
}

 

If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.

Regards,

T Mohan.

Community Alums
Not applicable

Hi @deepika adimu ,

Best to use read ACL to hide/Show that field based on role.

or

Hiding a field is controlled by Client side so you can use either UI Policy script or Client script. 

Use OnLoad Client side code :

function onLoad() {

if(g_user.hasRole("Mention the Manager role")) // Provide the role
{

    g_form.setDisplay("Field name",true);

}
else
{
    g_form.setDisplay("Field name",false); //
}

}

 

Mayur2109
Kilo Sage
Kilo Sage

Hi @deepika adimu ,

 

You can write a onLoad catalog client script and check for role condition to hide field.

function onLoad() {
    //Type appropriate comment here, and begin script below
    var user = g_user.hasRole('Role of ITAS user');
    if (user) {
        g_form.setDisplay('assignmnet group field name', true);
    } else {
        g_form.setDisplay('assignmnet group field name', false);
    }

}

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,
Mayur Shardul