- 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: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:25 AM
Hi,
One way is to make it readonly at Variable configuration level.
Or use OnLoad client script to make it readonly.
you can use below logic:
if(g_user.hasRoleExactly('itil')){
g_form.setReadonly('requested_by',false);
}else{
g_form.setReadonly('requested_by',true);
}
make sure there is no UI Policy making it Mandatory or editable.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 06:31 AM
Yup, these are the top 2 ways I'd use - if it was me , I'd surely go with Permissions config, as it's easier to do and maintainable by SNow.
I have a massive catalog performance issues exactly due to large catalog scripts, which were growing over the years and now it's total pain to rework the cat items... I was thinking this can happen only on purpose, but there are items giving timeout or best taking like 30+ seconds to render - rootcause => too many catalog client scripts where more than a half could be avoided using OOB functionality.
Just sharing my recent experience, not saying one should not use those. 🙂
Cheers,
Joro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 05:36 AM
If this is for catalog variables (I got it this way) - you can open the catalog variable definition in question (requested_for) and use Permissions functionality :