how to make fields readonly on workspace contextual side bar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 02:32 AM
in workspace form, their is one contextual side bar template .
when user open the template, fields are in editable as shown in below screen shot. i wanted to make them readonly for a set of role user.
how can i achieve that functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 02:44 AM
Hello @VSN
This contextual side bar should be a "Data Resource". So go the UI Builder and in this specific Workspace - look for data resources in the left side. Modify it in transform script.
If it's not configured using a data resource, then a client script can work. But you need to check this in your UI builder.
Kindly mark my answer as helpful and accept solution if it helped you in anyway,
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwN
eEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 03:21 AM
you can use table.Field level WRITE ACLs on "sys_template" table with that field and add script to check if user doesn't have role
OR
you can use onLoad client script on "sys_template" table and check role and make them readonly
function onLoad() {
if (g_user.hasRoleExactly('rolename') && g_form.getValue('table') == 'incident') {
g_form.setReadOnly('fieldA', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 04:34 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 07:50 PM
Hope you are doing good.
Did my reply answer your question?
Members have invested their time and efforts in helping you.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader