- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 05:20 AM
Hi All,
I have requirement like,
I have a 'requested by' varaible Reffering to user table, Currently this variable is editable for all the users. users is asking 'requested by' variable is editable only for 'ITIL' role users for other users it should be Readonly. Can any one help me on this.
Thanks,
Prasad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 05:24 AM
Hi @prasad39
You can use catalog client script.
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
01-18-2024 05:39 AM
Hi @prasad39,
Write onloadcatalog client script with below script
// Check if the user has the ITIL role
if (g_user.hasRoleExactly('itil')) {
// If user has ITIL role, make the "Requested by" field editable
g_form.setReadOnly('requested_by', false);
} else {
// If user doesn't have ITIL role, make the "Requested by" field readonly
g_form.setReadOnly('requested_by', true);
}
}
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand