Fields are not getting setReadOnly False on cmdb_ci_computer table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 12:12 AM
Hi
I want to give access to 3 fields on cmdb_ci_computer table. so wrote BR and Client script for it. Also I tried with ACL with script but it is not working will you please help me in this. In client script I tried with role aslo but it is getting ReadOnly False.
Client script:
function onLoad() {
// if (g_scratchpad.isMember.toString() == 'true') {
if (g_user.hasRole('cmdb_user')) {
g_form.setReadOnly('assigned_to', false);
g_form.setReadOnly('assignment_group', false);
g_form.setReadOnly('x_fls_flexera_fnms_calculated_user', false);
}
}
BR:
(function executeRule(current, previous /*null when async*/) {
//g_scratchpad.isMember = gs.getUser().isMemberOf('CMDB Access');
g_scratchpad.isMember = gs.getUser().isMemberOf('7bb7b0861b220d90e4df4229bc4bcb3d'); // CMDB Access
})(current, previous);
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 12:17 AM
Hi Vishwas,
Your requirement is confusing, are fields displayed as read-only all the time or what.? Check dictionary of those fields if they are ready only from there or not.?
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 12:21 AM
No, they are not read only from dictionary.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 12:31 AM
Hi Vishwas,
Please check following from where fields might be getting read only.
1) UI policy.
2) Client script
3) ACLs
4) UI action( least likely)
There must be something existing which is making them readonly and mostly through ACLs please check thoroughly.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 12:38 AM
Hi,
You are making them editable using onLoad client script for group members
So are those fields readonly by default when form loads?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader