- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 08:24 AM
How can I set a variable on the Change request form to be read-only depending on logged in user's role
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 08:31 AM
You ca do so
- By an ACL, Read ACL on change_request.field_name and add the role to the ACL
- Use a client script, onload
if(g_user.hasRole('<role name>')==true) { g_form.setMandatory('<field name>', false); g_form.setReadOnly('<field name>', true); }​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 08:31 AM
Hi @Bret Smith
Use ACL
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 08:31 AM
You ca do so
- By an ACL, Read ACL on change_request.field_name and add the role to the ACL
- Use a client script, onload
if(g_user.hasRole('<role name>')==true) { g_form.setMandatory('<field name>', false); g_form.setReadOnly('<field name>', true); }​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 09:27 AM
Hi @Bret Smith ,
create an ACL for specific roles only have read access.
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/