- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 10:03 PM - edited 02-21-2023 04:08 AM
The following is the Script I wrote for the above problem It doesn't seem to work. I want feed back.
function onLoad(){
// condition to check roles of user
// other than users with roles ITIL
if( ! (g_user.hasRoleExactly("itil") || g_user.hasRoleExactly('admin') ) ){
// setting to readonly
g_form.setReadOnly('assignment_group',true);
g_form.setReadOnly('assigned_to',true);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 11:43 PM
why not use field level WRITE ACLs on those individual fields?
update script as this
function onLoad(){
// condition to check roles of user
// other than users with roles ITIL
if(!g_user.hasRoleExactly("itil") && !g_user.hasRoleExactly('admin')){
// setting to readonly
g_form.setReadOnly('assignment_group',true);
g_form.setReadOnly('assigned_to',true);
}
}
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 02:21 AM - edited 02-21-2023 02:24 AM
Try this field level ACL with script. It should work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 01:24 AM
Thank you for marking my response as helpful.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 03:15 AM
Please close the thread by marking response as correct.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 02:21 AM - edited 02-21-2023 02:24 AM
Try this field level ACL with script. It should work