Record Producer: Questions and some viewable to all users and others viewable to specific users

cyoshimoto
Tera Contributor

Hi,

 

I am looking to create a record producer that will have multiple options.

Several options viewable to all users.  Two options only viewable to specific roles (Supervisors/managers).

 

Is there a way to do this? 

 

1 REPLY 1

Sid_Takali
Kilo Patron
Kilo Patron

Hi @cyoshimoto You can write a Catalog Client Script like below 

function onLoad() {
    g_form.setMandatory("set field name here", false);
    g_form.setVisible("set field name here", false);
    if (g_user.hasRole('admin')) {
        g_form.setMandatory("set field name here", true);
        g_form.setVisible("set field name here", true);
    }
}

https://www.servicenow.com/community/in-other-news/hide-fields-depending-on-logged-in-users-departme...

 

Regards,

Sid