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