- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2025 03:09 AM
Hi,
I am trying to set a variable in the catalog item to read only for other than Service Desk group at the sc_req_item level. I tried it but still non Service Desk group is able to edit it. Kindly help.
(function executeRule(current, previous /*null when async*/ ) {
if(gs.getUser().isMemberOf('Service Desk'))
{
g_scratchpad.variable = true;
}
})(current, previous);
function onLoad() {
if(g_scratchpad.variable!=true){
g_form.setReadOnly('features', true);
}
}
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2025 06:40 AM
Hi @Ankur Bawiskar,
I am definitely not as good as you, but I can guarantee we can use g_scratchpad for catalog item. The only change i made is checking the checkbox in the catalog client script.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2025 03:38 AM - edited 09-16-2025 04:26 AM
Hi @ServiceNow Use6,
The logic you write seems ok, double check your business rule condition "item is a" mentioned in your shot:
Does it make any sense?
hope this helps!
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution and helpful so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2025 04:23 AM
I think issue is in condition that you are using in BR (item is a) may be because of it is not triggering.
I just tested on my PDI below scripts are working.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution and helpful so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2025 05:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2025 06:22 AM
please check my above response regarding workaround.
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
