Make Catalog variables Readonly for Specific Groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2023 11:53 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2023 01:10 AM
Hi @Vamshi_ch123 ,
Have you set the type of Client Script to all?
Please mark this response as correct and helpful if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2023 01:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2023 01:48 AM
Uncheck 'Isolate script' and try below once.
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.toString()) == 'true') {
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);
}
}
}
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2023 01:37 AM
Hello,
Try below.
Regards,
Musab