scratchpad field set readonly for non ServiceDesk group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 2 hours ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
40m ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11m ago
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