Make Catalog variables Readonly for Specific Groups

Vamshi_ch123
Tera Contributor

Hi, I would like to set catalog variables as read-only for two specific groups. I've created a new role and assigned this role to those groups based on information from a community blog and implemented the following onLoad client script. However, when I impersonate and check, it still doesn't seem to be working.

 

function onLoad() {
    // Ensure that g_form is defined and available
    if (typeof g_form !== 'undefined' && g_form) {
        var SaaSUser = g_user.hasRoleExactly('PAM_Access_Groups');
        if (SaaSUser) {
            g_form.setReadOnly('lob', true);
            g_form.setReadOnly('customer', true);
            g_form.setReadOnly('group_name', true);
            g_form.setReadOnly('group_to_be_added', true);
            g_form.setReadOnly('first_user_name', true);
        }
    }
}

 

Thank you

1 REPLY 1

Musab Rasheed
Tera Sage
Tera Sage

Hello,

You can try either of one.

https://www.servicenow.com/community/developer-forum/set-variable-to-read-only-based-on-role/m-p/162...

Please hit like and mark my response as correct if that helps
Regards,
Musab